PHP is a widely-used, general-purpose scripting language that is especially suited for web development.

learn more… | top users | synonyms

1
vote
0answers
5 views

Using Symfony forms without a database entity

I've been developing an application based on Symfony 3, and part of that application involves an import process where a user can upload csv files. One thing that I've never been too sure about with ...
1
vote
0answers
6 views

Api with security through a private and public key

I want to make users login into an app, the code on my server serves a "token". This is based on a salt that is saved for each user, the login date, expDate and the userId. That value is hashed by the ...
2
votes
0answers
45 views

Database Query Optimization

I made a website where is possible to search for the best transportation from a place to another. For instance, i need to go from Berlin to Bremen? the website will search in its internal database for ...
0
votes
0answers
11 views

How to write nested joins with Laravel Query builder? [on hold]

I have SQL query with next join order (two JOIN's are nested in LEFT JOIN): ...
0
votes
0answers
21 views

Moving the HTTP and Request to controllers and Routes

I am new to Laravel framework and I made a project application which is working fine but someone said You should avoid accessing the Request object in your views. here is the full application ...
0
votes
0answers
8 views

Is this the best way to update data in Symfony2, Doctrine

I want to make post editing on my blog, I get data from form and want to put it into database. This is how it looks like: ...
-3
votes
0answers
33 views

What is wrong with this PHP code? [on hold]

I'm trying to get the basics of PHP down. I have the following code. ...
-3
votes
0answers
41 views
3
votes
1answer
53 views

Securing PHP using a gateway that consults a whitelist

My site was recently infected and running malicious scripts. Once I discovered this, I cleared everything, the hosting company re-initialized the VPS and I setup my site anew. This is how I run my PHP ...
1
vote
1answer
47 views

Phishing Project UserIterator Implementation

As I stated in an answer comment on my previous question, the UserIterator has a much larger footprint than I think most people realize. This question is here to further explain the project, the ...
3
votes
0answers
25 views

Convert accented character to user name

I am using below function for converting the accented character to user name. ...
-1
votes
0answers
20 views

I think I am doing something wrong by checking post like in this verbose manner [closed]

How can I make the check for whats posted less verbose? Here is my code ...
3
votes
0answers
43 views

Let users create custom blade templates

Problem: I need to let my web-app users create their own blade layouts. The content shall change based on what is in the database, hence their layouts should become dynamic in nature. With only the ...
1
vote
1answer
60 views

Moving To Object Orientated Programming

Please keep in mind I am new and still learning when reading the following. What I am doing I have the following code which pulls a sport, tournament and round NR, from a DB table called ...
4
votes
2answers
60 views

Phishing Project Sending Email with Configuration Classes

As suggested by @MikeBrant in the previous question, I've added in two configuration classes to simplify and more broadly organize the objects required to send my mail messages. This also removes the ...
2
votes
0answers
80 views

Simple TCP proxy

EDIT The previous proxy code, after thorough testing, had issues with the stream_copy_to_stream() when sending from $client ...
0
votes
1answer
30 views

Slider php loop

I am working on a image slider for a website, the user can add up to 0 - 3 images to the slider. You can see how I did this below, what kind of loop should I use to make this code more efficient and ...
1
vote
1answer
44 views

CSRF-prevention mechanism for a form

I am using codeigniter framework in PHP. In signup form I have: Controller: ...
4
votes
2answers
195 views

Phishing Project Sending Email Reworked

@Pimgd gave some good feedback on the previous post. I've made the changes that I think best suit my application and am looking to see what people think of this implementation. PhishingController <...
0
votes
1answer
44 views

Initial stages of MVP, is the bootstrap file efficient coding

I am attempting to put my new OOP skills to the test and am eventually going to build a simple OOP login/registration system. However as I am making use of OOP I have decided to make my own simple ...
3
votes
1answer
69 views

Factory method that constructs objects that represents MySQL data types from query results

I'm writing a package that is designed to provide a convenient way to inspect the schema for a database. The goal is that I can use it for generator code to suit the schema. The complete code can be ...
0
votes
1answer
30 views

Code to join filesystem path strings in PHP

Following code has some issues: ...
2
votes
1answer
63 views

Phishing Project Sending Email Assessment

I've gotten a lot of feedback about my tracking system already. So now I'm changing gears and looking at my email generation system. I have a class called Email which manages the sending of emails, ...
1
vote
0answers
23 views

Developing a Feed Reader in the MVC Architecture are there better posabilities?

I'm redisigning my old Feed Reader APP with the MVC architecture, to understand the OOP better, currently there is just registration functionallity implemented, ...urrently workiing on the session ...
1
vote
1answer
41 views

Simple router for updating users

I need to know if I am going in the right direction with my code so far. I am really trying hard to transition from procedural, page-based programming into OOP MVC. So far I have written a simple ...
1
vote
1answer
36 views

Log collisions in generating unique random strings

I've created a small class to generate unique random strings. It works fine. I also want to log the collisions of the generated strings. I check if the generated string is in the array for uniquness: ...
1
vote
1answer
47 views

Phishing Project Webbug Implementation

Here comes the next round. I've implemented some of the suggestions from the previous review. That being said, though, there are a few things that I have on the horizons but haven't yet put in that ...
0
votes
0answers
22 views

Model controller relation

I am creating a PHP app in MVC (no framework). I am having a difficult time understanding how the Model and the Controller communicate in an optimal manner. User.php ...
0
votes
1answer
43 views

PHP PDO login with session

index.php,general message.php, logout.php, site life.php (this page for session and put it in the other pages by required) Database: connection.php ...
3
votes
2answers
84 views

Checking a user's emails using an ID

I'm trying to do this: Getting user's ID based on his email name. Using that user_id to check all his emails that have been sent for him so far. ...
3
votes
1answer
56 views

Phishing Project Error Logging

Moving on to the next steps! Previous review was here. The idea here was to implement suggestions made by @hd/@Pimgd and then implement an effective way of tracking and logging results when an ...
7
votes
2answers
667 views

Phishing Project Assessment

Coming back for another look at my project after I've reworked a few of the key points made in my previous post here. So far, I've rewritten most of my code to address SQL Injection. I've created a ...
0
votes
1answer
40 views

Accessing Models Directly Through AJAX [closed]

I was thinking about how to handle AJAX requests in a MVC environment in PHP in a easy way. What I've come up is (without showing you the backend code): ...
3
votes
2answers
56 views

PHP Authentication Form

Drafted this up today out of the need for a very simple php based login form to protect an html page. The app is simply included the top of index.html like this: <...
3
votes
0answers
21 views

Create archive webpage for newsletters based on nested array

I am creating a webpage for my newsletter archives. The archives are divided by year (currently there is only 1, but there could be many), then by topic, before listing each newsletter. There will ...
0
votes
0answers
32 views

Laravel Unit Test for API

I'm currently building an API with Laravel 5 and I've written some unit (or integrated?) tests for it. I've been reading a little about unit test and how to not overdo it and I would like some input ...
4
votes
2answers
198 views

LDAP Login Script

This is my first time ever having code peer reviewed! This is just the main function I'm concerned about. Edit Apologies for the initial vagueness of my question, this is the "login" part of my ...
3
votes
1answer
34 views

PHP & AJAX CAESAR CIPHER ENCRYPTED chat script - Slow in performance

I have made an attempt to make a chat script and its working as required but the problem is that it is slow on slower connections and sometimes even on fast connections. Sometimes while loading the ...
1
vote
0answers
26 views

Export database values as csv with a helper class

Should I be using getter and setter functions in my class nodeStruct? I am currently using them where there is need to manipulate the input value (e.g for ...
3
votes
1answer
84 views

Is this PHP code vulnerable to some attack? [duplicate]

So I've made a PHP code for a login form. But i am not sure if this code was that safe, because i am not a security expert. I am using PDO statements in my code, here's my code : ...
4
votes
1answer
66 views

Very basic PHP session handling

I’ve got my first real PHP web application up and running. It is working as expected, but being my first time, I’m sure there is plenty of room for improvement. Right now, there is one particular ...
1
vote
1answer
41 views

Preventing XSS in a Symfony form to add a timetable entry

I have started to implement cross site scripting prevention (xss) within my code. However as I am using symfony for this particular project I have read up that nothing needs to be done for xss in ...
0
votes
1answer
62 views

PHP login form with PDO

I create login form with session with four files: connection.php login.php plan.php logout.php Please check my code and tell about any smokestack. Database educate (create table users) ...
1
vote
2answers
51 views

Finding a word with the most occurrences of a character

I am new to PHP development. So Kindly, review my code and guide me make it better/optimize. Currently, it works well with inputs that I have tried. ...
1
vote
0answers
34 views

Printing many-to-many relationships in an HTML/bootstrap table

I need to print the many-to-many relation ship in my tablet. However, I don't know what to do for my case: I tried tons of ideas, however, I may have done something wrong because nothing worked. Here ...
2
votes
1answer
35 views

PHP upload script might be vulnerable

I have written a basic PHP upload script a few years ago and recently I discovered some phishing html pages in the website's root. This website is located in /www/sitename, while I upload the files ...
2
votes
1answer
67 views

Simple login page

Could anyone tell me if this code is well written and if it has bugs / vulnerabilities? class.user.php: ...
0
votes
1answer
31 views

Single endpoint for ingoing mail with multiple purposes

The following code is not one of my proud moments. In its initial state, I had only a single purpose, but know I'm up to three purposes and I don't know if it would stop there. I'm using mailin.io to ...
2
votes
4answers
61 views

PHP mysqli code for login form

Can you check my code if I wrote like a professional? connection page. form sign page. plan page. log out page. First I create the database and tables, then the connection file, then the form sign ...
0
votes
0answers
8 views

php - strpos vs preg_match - memory and resource differences [migrated]

There have been questions asking which is faster strpos or preg_match, but I'm interested which in knowing which uses the least memory and CPU resources. I want to check a line for one of 5 matches: ...