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.



function list_dir($dir)
                echo "<ul>";
                while ($file = readdir($handle))
                    if ($file != '.' && $file != '..'  && !ereg("\.php$", $file)) {
                print ("<tr>\n<td>\n");
                                print ("<li><a
                print ("</td>\n");
                                if (is_dir($file))
                        printf ("<td>");
                                                $toto = $GLOBALS["path"];
                                                $GLOBALS["path"] .= $file."/";
                                                chdir ($file);
                                                $GLOBALS["path"] = $toto;
                                                chdir ("..");
                        printf ("</td>");
                                        } else {
                        printf ("<td>\n");
                                                $size = filesize($file);
                                                if ($size == NULL)
                                                        $size = "<unknown>";
                                                printf ("&nbsp;".$size." 
                        printf ("</td>\n");
                   print ("</tr>\n");
                echo "</ul>";

$directory = "screenshots";

$GLOBALS["path"] = "http://".$HTTP_HOST."/".$directory."/";;

echo "<table>\n";
echo "</table>";


PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to