here is a pretty slick bit of code I picked up somewhere. It lists all the files and directories in a directory. Simply name it index.php and you're off and running.
<title> INDEX </title>
<body>
<h2>
Welcome</h2>
The list of documents and thier hyperlinks are given below.<p>
<?
//edit the $diraX to reflect your directory and $level is not used here.
// all directories under $diraX is all listed when this script is used.
// upload two other files file.gif and folder.gif to
function parse_dir($dira, $level) {
$dir = opendir($dira);
while (false!=($file = readdir($dir))) {
if ( $file != "." && $file != ".." ) {
if (is_dir($dira."/".$file)) {
echo "<tr> <td colspan=2><strong>".$dira."/".$file." is a directory containing the following files </strong> </td></tr>" ;
parse_dir($dira."/".$file,$level+1);
}
//$fa = $dira."/".$file;
//$fu = filesize("$dira/$file");
else {
$fu = round(filesize("$dira/$file")/1000,2);
//regexp = /\s/g;
$dirapp = preg_replace("/\s/","%20",$dira);
$filep = preg_replace("/\s/","%20",$file);
if ($filep != '.htaccess') {
echo " <tr><td width=50%><a href='$dirapp$filep'>$file </a> </td><td> The File size is $fu Kilobytes </td></tr> ";
}
}
}
}
}
$diraX = "./";
$level = 1;
echo "<table width=80% border=1>";
parse_dir($diraX, $level);
echo "</table>";
//closedir($diraX);
?>
</body>