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

learn more… | top users | synonyms

-1
votes
0answers
16 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
217 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. ...
0
votes
0answers
23 views

How can I make more maintainable jquery/php/mysql API for wysihtml5 widget?

For 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 code ...
1
vote
0answers
38 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
51 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
36 views

Autoregister model / library / helper

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

PHP Router class [on hold]

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? [on hold]

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
84 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
72 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. ...
0
votes
0answers
22 views

display subcategories of selected category in tabular form [closed]

I have a form that has two parameters amenities and attributes. The amenities parameter has a dropdown menu that whose value gets populated from a separate table. The second parameter is attribute ...
0
votes
0answers
19 views

better practice for Ajax long polling [closed]

I'm using PHP,Mysql and Jquery for my project which has an instant notification area.I'm using ajax long polling technique and this is the first time I'm using it. my jquery function is like this ...
1
vote
0answers
33 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
192 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
86 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, ...
2
votes
1answer
42 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
161 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
49 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
47 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
39 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
75 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
123 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
112 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
70 views

Simulate the way that php receive the form

Lets say I have this form ...
0
votes
1answer
54 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
47 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
43 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
82 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
53 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
56 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 ...
5
votes
1answer
68 views

Efficiently displaying elements in an array

I wrote the below method to list out the elements of an array, as well as adding the Oxford comma to the list if desired. However, my for-loop looks, perhaps, a little convoluted. Is there a better ...
3
votes
1answer
47 views

Form validation evaluation to avoid exploits

Please advise if the form validation script below is secure enough to avoid most types (all types?) of contact form exploits? I ahve found this script online, added some extra php finctions in hope to ...
1
vote
2answers
61 views

Is this page dispatcher secure/fast?

I'm using a index system to say: On index i use: <?php core::doPage(); ?> Core code is: ...
5
votes
2answers
135 views

My Authentication Service

This is the AuthenticationService I made based on Barry Jaspan's design, which is way better than the code of which I asked in a question a couple of months ago. I ...
-2
votes
3answers
63 views

More intuitive formatting for a SQL insert formed with PHP

I wish to know how to make this code (and similar) more intuitive: ...
3
votes
3answers
205 views

PHP Login Check

I use this block of code to check if the user is logged in (login stored in cookies as a plain text and pass MD5 crypted). As I'm a novice in PHP, I'm not sure that this is a correct way. Are there ...
3
votes
0answers
28 views

Simplifying the building of an adjacency array starting from a flat structure

Purpose: to make an adjacency PHP array with parent_id, name, level and ...
6
votes
1answer
82 views

Deleting a user from a database

I was hoping if anyone could tell me if I'm doing this correctly, I know there are other questions like this but everyone codes different and I just feel that I'm not doing this right. I'm trying to ...