Back to DFS's Workshop Page
Back to Agenda Page


Creating an index.html File Problem

This problem is part of the larger Creating a Picture Website project. It will process information passed from the form in the Editing File Info script. It will write the edited information to the grouplist.txt and piclist.txt files; display all of the thumbnails (having them serve as links to the original large pictures) and the new information in the browser; and, for later use, create an index.html file in the current directory. This is the most complex script of all those needed for this project.

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

  1. Copy the data for the grouplist.txt file from the $_REQUEST[] into local variables.
  2. Copy the data for the current directory and the server path from the $_REQUEST[] into local variables.
  3. Get the directory path below public_html for the pictures directory from piclist.txt.
  4. Provide a link on the browser output to the index.html file being created. This is for checking purposes.
  5. Open the index.html file for writing so that information written to the browser can also be written to the file for later use.
  6. Copy the data for the piclist.txt file from the $_REQUEST[] into local variables.
  7. Sort the data for the piclist.txt file on the group numbers and item numbers. This should be done as though the group numbers and item numbers are the last names and first names, respectively, in a telephone book. The new order will be used for the index.html page and the piclist.txt file. (N.B. I created a two-dimensional array using this data and then sorted it using an adaptation of the Bubble Sort code on my Pascal website.)
  8. Update the grouplist.txt file (version after creation).
  9. In a large loop, process the data for the piclist.txt file, displaying the data in the browser, creating the index.html file (click on the penultimate version and look at the source), and updating the piclist.txt file (version after some editing and sorting).

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