ikrico
nOObee
Joined: 13 May 2008
Posts: 1
3 Cash
|
 code for listing uploads by date
I am trying to find the proper adjustment that needs to be made to the following code in order to list the uploads in the opposite order( newest on top)
<?
/**
* Change the path to your folder.
*
* This must be the full path from the root of your
* web space. If you're not sure what it is, ask your
host.
*
* Name this file index.php and place in the
directory.
*/
// Define the full path to your folder from root
$path = "/home/user/public/foldername/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to
open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file ==
"index.php" )
continue;
echo "<a href=\"$file\">$file</a><br />";
}
// Close
closedir($dir_handle);
?>
thanx in advance
|