Filemanager
Script: |
<?php
$PHP_SELF = $_SERVER['PHP_SELF'];
if(!isset($dir))
{$dir = './';}
$ascsort =
"<a style=\"text-decoration:none\"
href=\"$PHP_SELF?sort=asc\">A...Z</a>";
$dscsort =
"<a style=\"text-decoration:none\"
href=\"$PHP_SELF?sort=dsc\">Z...A</a>";
$dp = opendir($dir);
while ($file =
readdir($dp))
{
$directory[(int)
is_dir($file)][]
= $file;
}
echo '<h3>Verzeichnisse</h3>';
foreach($directory[1]
as $z)
echo "<a href=\"?dir=$z\">$z</a><br>";
$sort = $_GET['sort'];
if ($sort ==
'dsc')
{
rsort($directory[0]);
} else {
asort($directory[0]);
}
echo "<h3>Dateien $ascsort $dscsort</h3>";
foreach($directory[0]
as $z)
echo "<a href=\"$dir/$z\">$z</a><br>";
closedir($dp);
?>
|
|