Tagged Questions

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

learn more… | top users | synonyms

3
votes
2answers
40 views

Auction function for a game

This is an auction function for a game where you can bid on houses on the website. You set a limit, and if posts limit below current bet or below your limit, it will raise the bid from current plus ...
6
votes
3answers
214 views

Simple PHP Validation Routine

I have created a simple validation routine in php and i'm wanting to make sure I am doing things efficiently.... ...
1
vote
1answer
24 views

When should I call set_exception_handler with this exception handler class?

This is a simplified version of ExceptionHandler.php: ...
2
votes
0answers
32 views

Laravel Testing: Is this testing too much of the inner workings?

So I'm using laravel for a project and have a InvoiceRepository and a InvoiceRepositoryTest and I have written the test first ...
3
votes
1answer
53 views

Getting a value from a database table dynamically

I am trying to create a forum using php in a MVC architecture. This is my database setup: Table: forum_categories ...
1
vote
1answer
61 views

Database update script

Previous question: Database input script I'd like this new question reviewed. ...
2
votes
1answer
63 views

Database input script

Is this code secure and valid? If so, can it be improved? ...
0
votes
1answer
29 views

using global $mysqli variable to access database [on hold]

I have a simple CMS that accesses a database to update, edit, and delete records. I have 4 main functions for each of this action. After I updated my code to the new ...
1
vote
0answers
35 views

Bulding a “LIKE” query in Yii2

This code is making an SQL query. The last andWhere() method adds a LIKE condition with one percentage sign at the right. I'm ...
3
votes
1answer
26 views

Secure INSERTs with Mysqli

Is this code well protected, and if not, could you tell me how it might be exploited and how to secure it? I'm using mysqli. ...
3
votes
2answers
47 views

First WordPress template

I wrote my first template, but didn't include any styling. What do you think? What's good what's bad? ...
4
votes
1answer
41 views

PHP MySQL Database class

This is a PHP database class. Yes, I know it's using the MySQL functions, which are deprecated, but I shall be updating it to MySQLi soon. Can you please review this code and give any comment on any ...
3
votes
2answers
49 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
37 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 ...
2
votes
1answer
29 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
33 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
43 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
11 views

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

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
41 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 ...
-1
votes
0answers
18 views
13
votes
2answers
546 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
283 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
21 views

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

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
236 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
37 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
62 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
60 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
23 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 ...
4
votes
1answer
89 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
78 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
41 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
43 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
92 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
61 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
164 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
73 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
32 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
48 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
77 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
126 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
117 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. ...