Back to DFS's Workshop Page
Back to Agenda Page


Editing File Problem

This problem is part of the larger Creating a Picture Website project. It will get information from the grouplist.txt (if it already exists) and piclist.txt files and generate a page with all of the thumbnails serving as links to the original large pictures.

Your script should, in the end, do the following.

  1. If the grouplist.txt file already exists, read the main title into a variable and the group names into an array. It is probably easiest for the end-user if you use subscripts starting with 1 instead of 0 so that they match with group numbers assigned to the pictures.
  2. Set up a form which will call the createindex.php script when the "Submit" button is clicked.

Notes

It is best to write initial code which uses hardset values for the directory paths for the current directory (which starts with /home/) and the server path (which starts with the name of the machine and ~userid). Once you have that working, you can get information from the $_SERVER[] array to assemble the URL for displaying the pictures along with the picture directory path below the public_html directory.

If an at-sign (@) is prepended to a function name, any warning message which would be generated will be suppressed. This is useful if you plan on dealing with the failure of the function yourself (as you should when grouplist.txt does not exist the first time around).


© 2005 DFStermole
Created 3 Dec 05
Last Modified 4 Dec 05