Category Archives: Web development

Overriding PHP.INI

It’s a while since I’ve needed to override the php.ini file on a per-site basis, and I hadn’t realised that since PHP 5.3, the process has changed slightly. Now, if you want a local ini file to be read, you … Continue reading

Posted in PHP, Web development | Leave a comment

Cherry pickin’

Oops. Made a change in the wrong branch of my git repository. Of course I knew there had to be an easy way of merging that one commit into the right branch, and there is. How to do it in … Continue reading

Posted in Web development | Tagged | Leave a comment

git: revert a single file to a specific revision

Turns out to be quite easy: Identify the hash of the revision you want to revert to, e.g. abc123 At the command prompt, type: git checkout abc123 path/to/file Why would I need to do this? Don’t ask But I definitely … Continue reading

Posted in Web development | Tagged , , , | Leave a comment

Automatically updating a WordPress blogroll

Years ago, I signed up to a social bookmarking system called Spurl. I’m really not interested in social bookmarking, but it had a handy feature: by inserting a bit of Javascript in a web page, you could pull all or … Continue reading

Posted in Blogging, PHP, Web development, Wordpress | Tagged , , | Leave a comment

Book review: PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, 4th Edition by Larry Ullman

I bought PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition) to use as a set book for an online intermediate PHP class that I teach. I previously used Web Database Applications with PHP & MySQL by … Continue reading

Posted in Databases, PHP, Web development | Tagged | Leave a comment

Accessing virtual hosts across a LAN

Like many web developers, I have a local Apache/MySQL/PHP setup for developing sites. To ensure maximum compatibility with live servers, I set up a virtual host for each site. That way I know all paths will work. For example, on … Continue reading

Posted in Web development | Tagged , , | Leave a comment

ADODB database abstraction library for PHP

I’ve been using this library for years to make my database interface code database-independent, but I am still discovering new useful functions. Case in point: today I was using the handy rs2csv function, which outputs a recordset to a CSV … Continue reading

Posted in Databases, PHP, Web development | Tagged , | Leave a comment

Preventing hotlinking of images

Using an .htaccess file to prevent people stealing bandwidth by linking directly to your images from another website is a popular and well-known technique. I needed to do this, but decided to take it a step further with a little … Continue reading

Posted in PHP, Web development | Tagged , , | Leave a comment

Who knew Javascript could be fun?

It gave me migraines till I discovered jQuery. Now I can validate a form with some simple CSS and a couple of lines of jQuery code. And today I had a rather odd requirement to toggle the colour of cells … Continue reading

Posted in Javascript, Web development | Tagged | Leave a comment

Chocs To Go is here!

The goal for students on the intermediate PHP and MySQL course that I’m running for IWA/HWG is to create a working shopping cart. The course starts in only three days, and I decided I’d better walk the walk and prove … Continue reading

Posted in Databases, PHP, Web development | Tagged | Leave a comment