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

learn more… | top users | synonyms

3
votes
2answers
25 views

Select products and config values from MySQL

I have working code that gets products details and config values from MySQL bit it's combined with HTML, I would like to know a better way to do this, maybe a class that I can use. ...
2
votes
0answers
18 views

Sorting an array to match the order of values of another array

I'm running hundreds of curl operations in parallel to my own API, the response array that I get is out of order ( the reason being that the first one to finish gets added to the response array ...
1
vote
1answer
17 views

Could this connection and query class be improved?

Wrote this class it allows me to connect to database and display as many columns as I wish to. I can just give it desired parameters and I'm done. I've commented about the parameters that need it to ...
2
votes
1answer
30 views

Naming a function and its parameters for adjusting a queue

I have a function that takes all items in a queue and increments their order (used to allow insertion earlier in the queue). ...
1
vote
2answers
30 views

Processing user input for a form

I'm still learning PHP OOP, so I'd like to seek for some expert advice or criticism regarding this code I created. In this script, I created the objects I need to process the user input from a form. ...
0
votes
0answers
8 views

Parse a .sql file via shell_exec returning null, suggestions? [on hold]

I've been scratching my head on this one for awhile but to no avail, shell_exec isn't a disabled function but the output is always NULL, anyone experienced this issue? Thanks in advance for any tips. ...
4
votes
1answer
33 views

Logger class for MVC Framework

I have created a logger class for my own framework. Now I am trying to identify the components which can be done in a better way. The logger class doesn't log anything inside a file but it logs the ...
13
votes
2answers
528 views

Pluggin' in Plugins

I'm currently working on an in-house project and a part of that project is this pretty standard plugin loader below. There must be a way to avoid so many ugly looking ...
3
votes
6answers
262 views

OOP PDO Database Connection

I'm currently learning about PDO, and trying to connect to the database and CRUD in OOP way, this is a simple code that I use. index.php ...
-1
votes
0answers
20 views

Feedback on a worksheet/reference sheet I made for a total-beginners adult web design class I'm teaching tonight? [on hold]

The worksheet's at: http://www.robertakarobin.com/anatomyofawebsite I made it using PHP and HTML. This is for a one-time, 90-minute class I've taught a few times that's intended to give adults a ...
5
votes
2answers
233 views

Custom MySQLI Class

I have created this MySQLI Class. I wanted to know if this class is secure enough to be used on the production websites or more improvements can be done to this class. ...
1
vote
1answer
33 views

More maintainable API for wysihtml5 widget

For an HTML calendar with jQuery, I put in event listeners to enable jQuery drag-and-drop that reads and writes to persistence using HTTP get and post with JSON structures. Now I'd like to make the ...
1
vote
0answers
51 views

License key generation & verification algorithm

I've made this for generating license keys & later checking if they're OK and valid. A key is generated per-user and has an expiration time. That works fine. Could anyone please check if it ...
3
votes
2answers
59 views

Can I further secure this blog post loading script?

The following code is developed around a mysql database where the posts table has 3 columns: post_ID, date and title. config.php holds the values for $dsn, ...
1
vote
0answers
37 views

Autoregister model / library / helper

I have an array $autoload: ...
-1
votes
0answers
33 views

PHP Router class [closed]

What do you think about this router? is there anything else i can do to make it better? ...
3
votes
1answer
22 views

Loop through products and return first product that matches criteria

I am writing a function which loops through an array of products. The function needs to return: the ID of the first product that has an image and is ...
-2
votes
0answers
12 views

I am recieving 'user_max_connections' often and it says this code is the problem, I am not knowledgeable enough to know why? [closed]

I have been receiving lots of 'user_max_connections' errors because of this code. Please help. I do not understand why really. I am hosting with iPage and only have about 100 active users or less on ...
4
votes
1answer
87 views

Is this system to block bots reliable?

I've got a page which contains a form: when page is requested, a session is stored: $_SESSION['ok']=date("His"); Plus, the form contains this hidden field: ...
4
votes
2answers
76 views

PHP MVC model structure

Just looking for some feedback for one of my models I have for a project. I'm pretty happy with it but I was wondering if anyone had any optimization suggestions. ...
1
vote
0answers
35 views

Drop-down list with 14 options of RSS feed dates

The goal of this code is to create drop-down menu where there are 14 options on the list. Those 14 options are the dates that an RSS feed were last updated. The URLs for the feed have the query ...
1
vote
1answer
50 views

Mapping/parsing database table data to output data

I have currently implemented this simple example of a database to output for a REST API to show the way information is being parsed, mapped and serialized starting from database data converting it to ...
8
votes
4answers
194 views

Blog/Forum implementation

I've started learning PHP for university-related projects today. I tried implementing a basic blog/forum. Here's the full source code. It has the following features/design-decisions: There are ...
2
votes
1answer
40 views

CAPTCHA with images of objects

This CAPTCHA is not text but basically images of objects that the users has to identify between an array of options. My current code is kind-of slow because the query takes almost .7s to execute and ...
5
votes
1answer
89 views

Is this query really vulnerable?

Is the following query is vulnerable in terms of $itemstatus? I want to be sure about it. $yesorno is a user input which is ...
4
votes
2answers
59 views

Calling new classes

I have a switch in the index.php file. When there is a value in the $_GET['page'] and it matches the switch it includes a page, ...
3
votes
1answer
47 views

Simulating Natural Sorting in MySQL with PHP

I have a MySQL table which contains product SKUs among other things. PHP powers importing data into this database, managing data through a control panel, displaying the information on the front-end, ...
10
votes
2answers
162 views

Is this HTML Helper good or bad?

I have written this HTML static class which may categorize as a helper (not really sure what the definition of helper is). Anyways, I was just wondering if it was a smart idea to call a bunch of PHP ...
1
vote
1answer
57 views

CRUD implementation using Laravel 4

I just started using Laravel 4. I read some tutorials on how to implement CRUD in Laravel, and I was able to develop a portion of it. What I am going to show you is more on Controller and Eloquent ...
2
votes
1answer
49 views

Class to get user information

I've just begun creating a class to get User information, and I'd like for it to be improved. The global variable $oConni is the database connection. ...
3
votes
1answer
31 views

Geocoding library

I've written a Geocoding library that is hosted on Github. It has got 7.9 rating by the scrutinizer. I've checked and the only thing that I think I can improve is ...
0
votes
0answers
44 views

Laravel Pagination: a new one adapted from an old Dreamweaver extension

I'm new to Laravel and I'm trying to port the most important old-procedural-code snippets and libraries I collect in some years I missed a nice Pagination I had in an old Dreamweaver extension and I ...
1
vote
1answer
76 views

Extracting components of a street address

I have got the following function in my class that I think can be further be improved but I'm lacking ideas how: ...
2
votes
2answers
125 views

Simple Database Abstraction Layer

I'm learning PHP and currently object-oriented programming. I would like to get a feedback; how I'm doing so far. If I have bad coding that should be fixed immediately etc. I'd call this code an ...
2
votes
1answer
92 views

Redirecting to another page

...
1
vote
1answer
39 views

Checking if a relationship exists

I'm using a many-to-many relationship between users and roles with propel: ...
9
votes
2answers
113 views

PDO connection via INI parser classes

A few days ago I asked this question and I've got an answer to work with interfaces. I've tweaked around with this to get myself a INI parser class. ...
3
votes
3answers
71 views

Assigning database credentials

I have a config.ini that contains my database credentials. I retrieve them with a parser class like this: ...
3
votes
1answer
108 views

Security flaws in smartphone application

And could you give me any security and optimization recommendations? ...
2
votes
0answers
71 views

Simulate the way that php receive the form

Lets say I have this form ...
0
votes
1answer
55 views

Nested try/catch with PDO in PHP

I would like to know if this is the correct way to use try/catch when dealing with multiple MySQL queries and PDO: ...
4
votes
2answers
102 views

Accept an object and generate a email

I have a question regarding optimizing a php email class. It's basically a wrapper class than needs to be able to accept different objects and always output an email. I'm trying to make it generic, in ...
0
votes
1answer
48 views

Correct MySQL DB Query and processing

I ve got a table called EXP it looks like this The table contains REG_ID - (id of the registred users) TRA_TYPE - (type of transportation the user chose 1-export 2-import) PRO_ID - (product id ...
1
vote
0answers
44 views

Uploading a file using Symfony 2.5 strictly

Recently I have been looking into Symfony framework and I am working on a task where I need to upload a file using a form. Once the form has been submitted I need to insert the user input along with ...
3
votes
3answers
83 views

PDO insert from check boxes

I've seen so many different ways of doing this all seem very complex and all seem to be done in MySQL. I'm using PDO in my project so I've had a go myself to see what I could come up with. Is this ...
7
votes
1answer
56 views

Testing uptime of my personal server

I made some code to test my personal servers uptime. It logs in to my router page and sees if it returns status 200. A cron job runs it every 5 minutes. Please let me know if I can make the code more ...
3
votes
3answers
58 views

A PDO connection classto initiate multiple connection and easy access

I've been looking for a way to make the database connection easy available directry from any script, and from inside other classes. And since I tend to have different connections based on what action ...
11
votes
4answers
159 views

Improving the readability and efficiency of parser code

Recently, I had a test and I wrote this code, but they didn't like my code because it was "deplete and nested". In order to improve my skills, what would be good ways to make this more readable and ...