PHP is a widely-used, general-purpose scripting language that is especially suited for web development.
0
votes
0answers
10 views
Acquiring payment service ID
I have a utility class, called Bills, that extracts some information from a billId and a ...
0
votes
0answers
8 views
PHP detect group members [on hold]
Please tell me where my errors are/how to achieve my goal. I am trying to find all users with group "group".
Code:
...
-2
votes
0answers
27 views
How to refactor class with fluent interface?
I have class SingleElement (hard to say if it is the most suitable name, due to its purpose) that uses non-related class ...
1
vote
2answers
24 views
Assigning browser cookies for A-B testing
The following code creates a cookie on the client browser such that 25% of the browsers will have a value 0, and 75% a value of 1. Can anyone review the following code and point out any problems in ...
2
votes
1answer
18 views
0
votes
0answers
18 views
Render HTML/JS with Values for jQuery Modal Boxes
I have some code that I use to render the template + values for the HTML that makes up jQuery Modal Boxes in my code.
...
0
votes
2answers
41 views
PHP alternative syntax confusion
Newbie to PHP.
Trying to output the results of an array inside a foreach loop. I have got the following code but I cannot understand what to do with it next.
Mainly;
Where/how do I start and end ...
1
vote
1answer
32 views
Database query inside a method of a class and return data [on hold]
I'm trying to find out what is the right approach to return DB values from a class. This is what I came up with:
...
0
votes
0answers
19 views
Command and observer pattern to build installer wizard
I've done this mainly as an exercise to understand these design patterns. I'm writing a theoretical install wizard which will allow users to select different options throughout, and have it execute ...
0
votes
0answers
16 views
Design Pattern - Abstract Factory Pattern Implementation in PHP
Products Class that are like
Table
Chair
etc
Pls review it and give your thoughts and let me know if there are any rooms for improvisation.
Products.php
...
1
vote
1answer
38 views
Design Pattern - Strategy Pattern in PHP
Take a look at the following code and let me know if its right, and if there is any room for improvements.
Strategy Class
...
0
votes
0answers
14 views
How to load this javascript without interval [closed]
I have create a round clock but its load more
how to solve this?
my code:
...
-2
votes
0answers
48 views
Beta login api without passwords
In present day, people are asked more & more for new and more difficult passwords all over the web. To be honest, in my case, it is becoming a real struggle to remember all those passwords and I ...
3
votes
1answer
35 views
Autoloader class for PHP
I created a class that I plan on using to autoload my project classes (20-30 classes) maximum. I wonder if there is anything, anything at all, that I can improve on this class to improve it any ...
3
votes
0answers
40 views
MySQL connection using a static connection
I have been using a static class to connect and retrieve information from a MySQL database and also reading about how static works in php. I'm still not sure if the code is bad or not and why (besides ...
2
votes
1answer
30 views
php/html template for checkout
Basically I am in argument with my colleague, I say this template (view) has to be fully refactored and all instances of duplicate code has to be removed. He disagrees and don't want me to touch it. ...
3
votes
2answers
41 views
“Remember me” automatic login
I've implemented a "remember me" automatic login if no session has been set, but a remember me cookie is on their computer. I'm concerned about security and I'm not the best. I'm relatively new to OOP ...
0
votes
1answer
53 views
Proper class user.php
I'm learning to program with PHP, so I ask your help to check if my class user.php is ok.
...
1
vote
2answers
30 views
Correct syntax and improvement account.php file
I wanted to ask your opinion about my code created for acccount.php page for editing the data of each logged-in user.
I wanted to have more of an opinion on your right syntax, though maybe it could ...
4
votes
1answer
33 views
PDO connector class
I have created a DB connector class with PDO.
Do I need to add, delete or edit anything in this code?
...
2
votes
2answers
53 views
Validating user credentials and logging into a Symfony site
I have the following code in a Symfony site that validates a user's credentials and logs them in via the Session class:
...
1
vote
1answer
38 views
Merging two multidimensional associative arrays
I just wrote a function that will loop through two multidimensional associative arrays and merge them together based on the key names and their values. While I'm satisfied that this function works, I ...
3
votes
2answers
347 views
Web dashboard using many REST API requests
I have created REST API in codeigniter. REST sever created in codeigniter 3.0 and REST client created codeigniter 2.x.x.
I have wrote simple code for login. After login client created dashboard ...
5
votes
1answer
45 views
Multilanguage class that detects and sets language
I have been learning object oriented programming for quite a while. I understand many concepts about it but I quickly realized that I made a big mistake just reading theory and not doing any actual ...
0
votes
1answer
29 views
Toggle-able checkbox custom post meta
I have created a basic checkbox custom meta box in order to set a post as "featured".
...
-1
votes
0answers
40 views
Laravel 5 package structure
I'm new with laravel and created my first package, which is a simple cms system. The package is nearly finish and I want to know if I followed the right conventions. What did I wrong (in the code or ...
2
votes
2answers
38 views
PHP Dynamic QueryBuilder function - Security
This function is a working function, which builds a number of queries depending on the values of $_POST.
...
1
vote
1answer
30 views
Class to create dynamic php + mysql queries (safely)
I've started to learn PHP classes, interfaces, extends and things related to those.
Before this i've worked only with functions and it started to be quite a mess with hundreads of separate functions.
...
2
votes
1answer
55 views
Creating new team matches
I have a class which creates a new match. My problem is that I am sure the code is unnecessary long and can get much improved (just keep in mind it is beginner level).
Specifically, I would like to ...
3
votes
1answer
47 views
Displaying a 0-7 ratings graph
I store ratings in a table called ratings.
The table has these columns:
id | user_id | value | ip | showcase_id
value is ...
3
votes
1answer
49 views
City and District class examples for teaching OOP in PHP
I wrote these two classes for teaching OOP in PHP. Do you think it's breaking some good practices or SOLID principles?
...
3
votes
2answers
55 views
Read a config file into an array
I just wanted to know if this looks like a good way of reading a config file. Is this code good? Is it clean and easy to follow?
...
2
votes
1answer
44 views
Simple calculator in PHP utilizing MVC
I have been struggling with understanding Model, View, Service, Controller architecture and wrote some code.
Is my Model class the Model part of MVC (did I define ...
0
votes
1answer
114 views
CRAP index (56) in Web Scraper Engine
I am working on a Web Scraper for the first time using Test Driven Development, however I have caught myself into a huge CRAP (Change Risk Anti-Patterns) index (56) and I can not seem to find a ...
1
vote
3answers
38 views
Navigation script and template
Overview:
I'm using the following page template and scripts for navigation. I use a single page that loads menus and context content, and then use ajax or GET variable to load main-div's content, by ...
3
votes
3answers
76 views
XML parser using PHP
It is just one of the files. I have also tried to write some tests using PHPUnit. Please give me some suggestions to improve my coding-writing skills.
The below is the test file for the above file:
...
3
votes
1answer
56 views
Possibility of SQL Injection
I am requesting a review of a portion of a 600 lines of code. This portion of the code process a filter that is farther down the page. It takes in the parameters and formats them into a query. Now I ...
2
votes
2answers
42 views
splitting multiple joined words, port from perl to PHP
Though i have never worked on perl, not even once.
I have ported the perl code into PHP and it seems like giving a correct result. But as I am going to use it on production server.
I want this code ...
4
votes
1answer
500 views
Persistent login (“remember me” cookie) using PHP
The code below is a attempt to create a persistent login cookie. I am an amateur and not professional so this is the first attempt to have secure remember me cookie. Now I want you guys to review two ...
-6
votes
1answer
50 views
I my code is vulnerable to sql injection Its hardly coded? [closed]
Is my code is vulnerable to sql Injection.It is hardly coded
...
1
vote
2answers
56 views
Basic template engine
I wanted to know how I can improve it. I mainly want to look at speed and performance, but if there are any improvements please give a suggestion.
...
1
vote
1answer
33 views
OPP Sign In/Out procedure in PHP
As a self-taught student of Web-Development and Web Technologies, I created a simple sign in/out form in PHP, just for practice purposes and some fun!
I read the O'reilly's book about PHP and I found ...
3
votes
1answer
46 views
PHP Configuration class
Created this little config class, any room for improvements? Think I have done an alright job but would like to know if any improovements could be made?
...
4
votes
1answer
96 views
PHP Route class
I was trying to keep it SRP. I'm new into PHP OOP and I'm wondering how I can make it better.
Route.php
...
2
votes
1answer
79 views
Beginner PHP calculator
I've spent the last few evenings learning PHP, CSS and HTML through Codecademy and now on Team Treehouse. My goal is to progress with PHP over the next year or two and perhaps obtain Zend cert.
...
8
votes
1answer
41 views
A Dockerfile for Composer (a dependency manager for PHP)
I recently built a Docker image for Composer. I'd love to get a review of the image, the Bash based wrapper script, its recommended use, and the repository structure.
Here's the Dockerfile for the ...
3
votes
1answer
37 views
Using a separate class in Symfony to handle a list of entities with controller injection
In my Symfony (v2.7.9) project I have a set of entities which share some view functionality i.e being displayed in a table with some of their values as columns.
Following the separation of concerns ...
4
votes
2answers
43 views
Better way for securing direct access to php files
I don't know if this method uses a lot of time to process, or if it is bad but I wanted to know if there is any better way of actually doing this? I have a few class files that I want to stop users ...
1
vote
2answers
45 views
Small PHP CMS base
I am a bit worried about this small PHP base as it has been running a bit slow. Can anyone notice anything majorly wrong with it?
root/Index.php:
...
2
votes
1answer
25 views
XHTML input for PHPmailer
I have used PHPmailer to send email to users upon registering to the site. Now, everything works as should, however, I find myself doing painstaking work adding the HTML elements in.
Here's an ...