From the category archives:

PHP

PHP Permissions

February 29, 2008

When you upload a file using PHP, you’ll usually want to use move_uploaded_file to move the file into a folder of your choice. The problem is that you’ll struggle with this unless PHP has permission to write to the folder.

Read the full article →

Pulling out a specific row from a MySQL database in PHP

December 4, 2007

I’m creating a randomised test. This test asks, say, 25 questions from a question bank containing many more questions. The obvious solution would be to generate a list of unique random numbers and use that to pull out a specific questionid from the question database. The problem with this is that it’s rarely possible to [...]

Read the full article →

Variable Variables

November 22, 2007

Here’s the problem. You have ten similar fields in a form called “field1″ to “field10″. You want to pull out the text value for each field and create a shorter variable for each. You’d want to do this in a loop because we all hate repetition don’t we? What you need is what PHP calls [...]

Read the full article →

Installing GD for PHP

October 22, 2007

I have to admit that my knowledge of Linux is pretty basic and it was tested to the limit when I wanted to add image manipulation to my PHP code. This requires the “GD” library to be accessible by PHP. The important thing to remember here is that, in most recent PHP installations, the capability [...]

Read the full article →

PHP

October 8, 2007

I’ve been looking into the object oriented features of PHP. Version 5, released a couple of years ago, introduced an almost complete (see below) set of features that turned PHP into a fully-fledged member of the OO club. I think PHP’s greatest problem in this respect is that many existing developers don’t see the need [...]

Read the full article →

Helpdesk

September 26, 2007

Running www.passyourtheory.co.uk involves, obviously, providing support to our customers and potential customers. Traditionally we’ve done this by publishing an email address and we pride ourselves on responding quickly. However, this has a number of drawbacks. Firstly, it means that a specific person receives the email and then needs to deal with it: this makes it [...]

Read the full article →