Access Menu options

PHP demos

I have spent a while playing with PHP and have got to know the basics. I suppose I would describe myself as competent at it. There are a few grey areas still, but I expect I will be covering them in due course

If you just want to see the scripts working then click on one of the links below, after that I will explain how they work

Dynamic table with list of CDs Image page with travel pictures
Dynamic table with list of DVDs Image page with a list of pictures from Glastonbury
  Image page with a list of pictures from near my house

There is also a simple chat application that I have written. By the time you should read this the site navigation and menus should be done with php as well but I will explain them elsewhere.

At the heart of the above templates is a class I wrote called 'csv' all it does is read from a csv (comma separated value) file and store the 'csv' all it does is read from a csv (comma separated value) file and store the in an array

There are two child classes to this at present 'dynamictable' for the CD and DVD list and 'piclist' for displaying the pictures. with most of the code in the classes it makes the templates very easy to read. For example the template to display the CDs looks like this

<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 Transitional//EN"> <?php //Php script to display an interactive list of Cds on my website // first declare the global variables $cdfile = "cds.csv"; $stylesheet = "cdstyle.css"; $templatename = "cdlist.php"; include("csvclass.php"); // no convert the parameters to global variables getparams(); //Create an instance of the class dynamic table $dtable = new dynamictable($cdfile,$searchterm,$searchcol,$sort,$dir); ?> <HTML>  <HEAD>   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">   <link REL="StyleSheet" TYPE="text/css" HREF="<?PHP print("$stylesheet");?>">  </HEAD>  <BODY>   <H1>A list of my CDs</H1>  <?PHP //display a search box    $dtable->displaysearchbox($templatename); //display the table   $dtable->displaytable($templatename);  ?>  </BODY> </HTML>

Which as you can see, is fairly basic, it also gives you a good degree of control over how the page looks. There are no styles applied to the table so you can use stylesheets. It would be very easy to adapt this to accept a parameter for the css file, as I do with the displaypictures template

It would be much easier to do this in SQL than a csv file but I have to pay extra for mysql and I was doing this more as a learning exercise than a useful app.

When I think they are up to scratch I will post the source files for the class here in a tarball with some documentation. They are not quite there yet but if you are really interested you can mail me and I will send them to you. It may be a while before they are up to scratch as I have a few other projects on