First I must state that I didn't write the code, and I'm not much of a programmer of any kind. I'm hoping someone can tell me how to sort the filenames and file sizes returned by readdir and filesize in the below code. Thanks in advance.
dan <? function list_dir($dir) { $handle=opendir($dir); echo "<ul>"; while ($file = readdir($handle)) { if ($file != '.' && $file != '..' && !ereg("\.php$", $file)) { print ("<tr>\n<td>\n"); print ("<li><a href=\"".$GLOBALS["path"].$file."\">".$file."</a>"); print ("</td>\n"); if (is_dir($file)) { printf ("<td>"); $toto = $GLOBALS["path"]; $GLOBALS["path"] .= $file."/"; chdir ($file); list_dir("."); $GLOBALS["path"] = $toto; chdir (".."); printf ("</td>"); } else { printf ("<td>\n"); $size = filesize($file); if ($size == NULL) $size = "<unknown>"; printf (" ".$size." bytes\n"); printf ("</td>\n"); } print ("</tr>\n"); } } echo "</ul>"; closedir($handle); } $directory = "screenshots"; $GLOBALS["path"] = "http://".$HTTP_HOST."/".$directory."/"; echo "<table>\n"; list_dir("."); echo "</table>"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]