PHP is a widely-used, general-purpose scripting language that is especially suited for web development.
-1
votes
0answers
10 views
records were on a new line and not separated by commas [on hold]
help to do so would when downloading images in the database there is a new field is now just poyavlyaestsya separated by commas, but as I have only after reloading the page problem here as I ...
2
votes
1answer
21 views
Register page for website
I've been working on a simple forum website as a toy project, to start learning PHP and SQL. I've implemented all of the functionality I want, but I thought I'd run the code by the Code Review ...
1
vote
0answers
35 views
Email thousands of customers from a PHP form using a MySQLi query on a MySQL database
How can a large internet service provider email certain customers to warn them about an impending service interruption? I'm providing what I think is a reasonable solution, but I have not tested it. ...
-5
votes
0answers
25 views
Get final date after skipping weekend and holidays [on hold]
I have 3 modules
Master
Holidays
Cases
Master: In master module I have 7 check boxes (Sun,Mon,Tue,Wed,Thu,Fri,Sat). Whatever checkbox is unchecked it means that is weekend day.
Ex: Friday, Saturday ...
2
votes
1answer
113 views
Auto loading code
I'm new to PHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards. ...
0
votes
0answers
32 views
An attempt at a cookie wrapper
This an attempt of a cookie wrapper of sorts. It has no real purpose nor do I encourage anybody to every use it in a production environment. It was made for fun, at best for practice.
The purpose is ...
4
votes
1answer
58 views
PHP, MySQL quiz application
I'm working on a quiz application for training purposes and I think I'm done with most of it.
However, I'm not comfortable with what I've done: it seems to be complicated and unprofessional and I ...
2
votes
1answer
46 views
Zip code reduce function
My task is to write a function that would take an array of zip codes and spit out only the zip codes that do not qualify. A non-qualifying zip code will not exist in the database and does NOT have ...
0
votes
0answers
15 views
Class App\Http\Controllers\Requests\ArticleRequest does not exist Laravel5.3 [closed]
Actually I'm very new of the php and Laravel5.3,and I have this problem when i want to set request of the form(Doing a simple blog page)
ReflectionException in Route.php line 339:
Class App\Http\...
0
votes
0answers
10 views
from json array to variable or mysql [closed]
I have this script to display some value from a json file:
...
1
vote
0answers
17 views
Laravel 5.3 model for mapping pages to multilingual translations
I have a Many To Many Polymorphic Relation like this:
...
0
votes
1answer
96 views
contact.php file
This is my contact.php file which has only 2 functionalities:
Response with the default page if it is requested by the get method
Process the message posted by the ...
1
vote
2answers
93 views
My included in every script file
I wish I found this site 4 months ago when I started PHP, when I wanted the experts to check the engine and wheels before I take off.
Right now I'm finishing my very first web application, and I will ...
0
votes
1answer
42 views
Searching in array by key => values
I need to write a function that searches the two-tier board according to certain parameters, which works, but I question whether there is a simpler, lighter way to perform this task.
...
0
votes
1answer
78 views
Calculating the difference between 2 arrays
I made this function to calculate the difference between 2 arrays and return it in a third array. I'm using this function as a part of stocktaking functionality I apply in my accounting system.
...
1
vote
0answers
48 views
Calculating the difference between two (incomplete) arrays
EDIT: a function to calculate the difference between 2 arrays
I'm coding PHP for only 4 months, and I need your help to improve this code
I have 2 arrays like this
...
2
votes
4answers
73 views
User Profile page - code quality , security & Performance feedback
once user login, we are displaying all the information of user in profile/account page. please check code quality , security & Performance.
...
0
votes
2answers
43 views
No getter/setter on model with many instance vars
I have been reading a lot of material on how to become better in OOP, DDD etc. While reading Object calisthenics and Getters/Setters. Evil. Period. I got confused. Let me explain it by example.
I ...
1
vote
1answer
22 views
A localization helper in codeigniter
I created a project to better understand CI3, while developing it I tried to introduce localization elements.
When I tried to localize the view everything messed up. I made a helper to identify if the ...
4
votes
2answers
56 views
Basic PHP Cloud script
I would like to add basic Cloud system to my website project. I have my php login system already included. Every person must be logged in to view this site.
There are several session variables like <...
0
votes
0answers
17 views
Pagination with ElasticSearch results
Technologies being used:
PHP 5.6
Laravel Framework 5.3 (with Blade templating)
ElasticSearch 2.4.1
Bootstrap (for CSS pagination classes)
...
4
votes
2answers
94 views
PHP OOP Login Script
I'm new to both PHP and OOP and would like some constructive feedback on a class I made.
I have a "main account" login system already setup and working; when the user logs in they're presented with a ...
-4
votes
0answers
27 views
pdo query innerjoin optimization
i need help optimizing this PDO query i would like to know if there is a better approach for this code and would like to make it cleaner and faster. right now it takes about 2 seconds to load one ...
-1
votes
2answers
55 views
Method to assign handle to organization object in one of multiple ways
I have a method that's called thousands of times during one process. Before optimization, it called the database on every execution. After optimization, it only calls the database when required. ...
3
votes
1answer
74 views
Populating a form with filtered hierarchical place names
My server performs a query to get all country data with Eloquent relationships:
...
0
votes
0answers
34 views
Zend Framework 3 Ajax Form Validation - contact form
I would like to present to you my code vision of Ajax form validation in Zend Framework 3. I am a beginner in Zend Framework and jQuery too, so I don't know that my solution is good and acceptable.
...
0
votes
1answer
53 views
Secure logout PHP code with cookies
I have the following PHP logout script and I would like to know the loopholes present in it. How can I improve it?
...
3
votes
3answers
31 views
Summing durations associated with each MAC address in a MongoDB result
I have a script which get data from MongoDB in the form of array and show the result. The array has a number of records in the thousands. A sample array is as follows:
...
1
vote
1answer
30 views
Class for creating save sessions in PHP
Is the following class well-built and secure or am I missing something? Any improvement ideas welcome.
...
0
votes
2answers
47 views
PHP create JSON file from Twitter API
I've been reading more on PHP JSON and APIs I wanted to play around and pull a user's tweets so I wrote a function that requires the TwitterAPIExchange wrapper.
The code:
...
0
votes
0answers
25 views
Tag that prints expressions for my template language
This is the PrintNode class from my template language Aegis. This class' purpose is to enable printing expressions (strings, variables, numbers, ...) in the language. eg:
...
1
vote
0answers
47 views
Secure login and authentication in PHP
This seems to work for me, but I want to make it more secure. I want to see how far I can go without pre-built packages/bundles, so please don't suggest any.
How secure is this? What are some steps I ...
0
votes
1answer
23 views
Factory hierarchy for creating GoogleMap and its elements
The purpose of this code is to create a GoogleMap using PHP, add markers to it according to Place objects from database, add infoWindows for these markers. While ...
0
votes
0answers
40 views
Handling routing with jQuery + Laravel
Basically, it's a matter of code organization, trying to delegate as most responsibility as possible to the server and keeping JavaScript use to a minimum, mostly as "glue" code between the view and ...
2
votes
1answer
54 views
Encrypting a user's file with a key that isn't stored but only known by the user
I want to make some kind of file vault. I want to store encrypted files in a MySQL table, and the key to encrypt/decrypt them is never stored but only known to the user (that's the goal, anyway).
The ...
0
votes
1answer
35 views
Protect against XSS with .htaccess file
My .htaccess redirects everything to my index.php, but I wonder if it's vulnerable to XSS attacks. Am I safe?
.htaccess file
...
-1
votes
1answer
45 views
Simple PHP SSH2 Class
I've written a simple PHP SSH2 wrapper class. Please review the code and point out mistakes.
...
3
votes
1answer
46 views
Structuring basic client side / serverside email form
I've been more than likely doing this entirely wrong for quite awhile and would like to correct that.
With the code review I would like to get critiqued on everything. This includes:
JQuery syntax/...
0
votes
0answers
30 views
File attachment validation from contact form
I'm relatively new to PHP programming and working on the server side, and I have this HTML contact form allowing people to upload a .doc, .docx, or .pdf file with the intent of emailing this uploaded ...
4
votes
1answer
83 views
Testing a Pivotal API request client using lots of mocking
I have a class that is all about doing HTTP requests, and logging (in file system & database). It's only using 3 dependencies to do these things, so I'm fine with the code so far.
Here it is for ...
1
vote
1answer
49 views
Ivory google map facade
I want to simplify this process of creating map, putting markers on it according to Place objects from my database, creating info windows. Using egeloen/ivory-...
2
votes
0answers
47 views
WordPress Settings Plugin security
I'm wanting to step into plugin development so I can eventually push to WordPress.org so I wanted to go through and really learn how to properly develop a Plugin's settings page. I went through ...
1
vote
6answers
46 views
Better way to write if/else conditions
I've got the following code where:
$urlParams is the school year from 7 to 11
$Comms['Overall'] is the total amount of "...
4
votes
1answer
62 views
PHP secure server2server communication
I read a lot about security mechanisms used in different APIs. But I'm still wondering if my own implementation is secure or not since it seems that there will ever be a risk of something you forgot .....
1
vote
0answers
53 views
MVC architecture for a Slim application
(https://github.com/trvshrmn/slim)
This is more of an entire project review... if this is 'off topic' I apologize. I attempted to make Slim into an mvc structure. I added a few controllers, views and ...
1
vote
3answers
54 views
Look for patterns in the keys of an array, to group them in a new array
I am working on a function that will take a an array of options. These options are retrived from a database, and could have other options inputted throughout the system. When adding my options, I am ...
1
vote
0answers
84 views
Extend the Laravel Eloquent model in order to easier implement CRUD REST for my routes
By extending the Model and using this inside my routefiles, I can easily call these functions inside the corresponding HTTP ...
0
votes
1answer
43 views
A PHP function that prints the url based on path
I'm trying to come up with a smart wordpress inspired PHP function that builds an url for my CMS. It has some different requirements that are almost all fulfilled so far.
Must use correct domain
Must ...
0
votes
1answer
51 views
Abstracting HTTP requests to keep it simple, flexible
The project is an API that will itself make HTTP requests to external webservices.
Since this is PHP, we actually chose to use guzzlehttp.
Now the library itself doesn't matter much, but I'm scared ...