PHP archive

I have been working with the PHP language since early 2001, first as the nerdy hobby of a spotty teen and then later into my career as a Web Developer. I try to write about PHP things that will be useful to me, useful to you, and everything in between.

First PHP Game

Remember when I talked about wanting to code some PHP games? (Yes, it was in 2008, what’s your point?) Well I finally managed to fit one in to my busy schedule last week, whilst avoiding studying for my current OU module. Ignoring the fact that it’s talking about points (only relevant for the final ‘install’)… read full entry »


WordPress Child Pages Page… or something

OK, back to srs business posts now… One of my current top secret projects (it’s not that exciting, I’m just helping someone convert their site to WordPress) involves creating pages with a list of child pages on ’em. Back in ye olde days I’d have done this manually (which meant every time a child page… read full entry »


NinjaLinks Feature Requests

I’m being nagged for a NinjaLinks update ;) If you currently use the script and have feature in mind, please add your requests here. Can’t guarantee a date for release (for obvious reasons) but will fit it in when I can.


On Tumblelogs and Why I Love Habari

For at least 4-5 years I’ve been desperate to turn my blog into a sort of “tumblelog”; that is, a blog that consists of multiple content types that you can easily update with more than just full on text entries. The problem is, at first I lacked the know-how to achieve it — my early… read full entry »


24 Hours with Habari

So here we are, 24 hours after moving nearly 2 weeks worth of work (on and off) and it’s still standing. I’m impressed. :) Anyway, given that I know my conversion is generating a lot of talk about Habari and interest amongst you guys I thought I’d collect together some of my initial thoughts. Let’s… read full entry »


SQL Injection Flaw in FanUpdate

A security issue has come to light in FanUpdate (2.2.1 specifically but likely affects previous versions). This only affects those who are still running with register_globals turned on (a very bad idea). The problem — for those interested — lies in show-cat.php relying on an unsanitised $listingid. In an ideal world, show-cat.php should only be… read full entry »


Beginner’s Guide to PHP – Part Six

Functions are the lifeblood of PHP. You can’t do a lot without PHP’s built-in functions, and life would get very tedious very quickly if you weren’t able to define your own in a script. Let’s take, for example, one of my scripts: BellaBook. BellaBook is a flat file guestbook and so constantly writes to files…. read full entry »


Beginner’s Guide to PHP – Part Five

Back in Part Four of the Beginner’s Guide to PHP, we covered the basics of arrays, and the foreach construct which is used to iterate over arrays. Today, you get to learn about for(), woot for you. According to the PHP manual, for() loops are the most complex in PHP, so I’m hoping I can… read full entry »


PHP Security Tips

Because you can never know too much, and it’s about time I wrote a follow-up to my PHP Script Checklist article. 1. Never include sensitive data in a .inc When I started my current job, one of the first things I did was move all of the database connection details (yes, that includes passwords) from… read full entry »


Beginner’s Guide to PHP – Part Four

In Part Three of the Beginner’s Guide to PHP we learnt about the if construct (“statement”), and using it to check the value of some input. In this guide we’ll learn about two more constructs: foreach() and array() foreach Construct foreach — a type of loop, but we’ll cover that more in the future —… read full entry »