I have a simple Script I got off of zend.com that lists all the files in a given dir.
here is the code
<?
/********************************************************************
* function that reads directory content and
* returns the result as links to every file in the directory
*
* toss it into any directory and get a list of links to every file
*
* This program is free software licensed under the
* GNU General Public License (GPL).
*
*********************************************************************/
function directory($result) {
$handle=opendir(".");
while ($file = readdir($handle)) {
if ($file == "." || $file == ".." || $file== "index.php" || $file== "index2.php") { } else { echo "<a href='$file'>$file</a><br>\n"; }
}
closedir($handle);
return $result;
}
?>
<body bgcolor="#FFFFFF" text="#000000" link="#CC0000" vlink="#CC0000" alink="#CC0000">
<p>
<?
echo directory($result);
?>
Here it is in action
http://www.caraudiotalk.com/fileupload/uploads/
Now currrently it lists the files by date modified....
is there a why to list them by name?