Back to DFS's Workshop Page
Back to Agenda Page


Navigating Directories Problem

This problem is part of the larger Creating a Picture Website project. It will allow navigation of a subdirectory tree so that the user can select a specific directory to work on.

For this problem, you are to cannibalize any available code and write a single script to navigate through the user's public_html directory tree.

Obviously, this will need to be a recursively called script. It will have to do the following.

  1. Using popen(), determine the path to the user's public_html directory; use a process call to pwd to access the information.
  2. Check the current directory path that was passed to the script; if it is empty(), set it to the full path to the user's public_html directory (e.g., /home/userid/public_html/).
  3. If the directory path was typed into the URL and is out-of-bounds, terminate the script.
  4. Determine the path of the current directory's parent directory.
  5. Create a form with a Select Box to allow the directory navigation.

Notes


© 2005 DFStermole
Created 30 Nov 05
Last Modified 9 Dec 05