The joys of PHP

It is a wonderful thing when something you think might be really complicated turns out to be really simple.

On www.davebriggs.net, I have three columns. The left one holds links common to all pages, including the internal site navigation; the centre one holds all the content; and the right one has links and stuff relevant to that page.

The problem with the left hand column is that if I want to make a change to it, I would have to do so with all the pages one by one. While this wouldn’t be too much of a burden at the moment, when the site starts to expand it would become seriously time consuming.

Fortunately PHP (www.php.net; http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=php) comes to the rescue. By typing the HTML for the menu content into a separate HTML file, called say “menu.html”, I can then call up that file anytime I like using:

<?php
include(“filename.html”);
php?>

And that’s it!

So all I have to do is update menu.html and ALL the pages change in line with that!

2 thoughts on “The joys of PHP”

Comments are closed.