$olddir = @$HTTP_GET_VARS['dir'];
$godir = preg_replace("(§)", "\\", $olddir);
#"
$next = "";
if($olddir != "")
{
$olddir[0] = preg_replace("(§)", "", $olddir[0]);
$next = preg_replace("(§)", "/", $olddir);
$next .= "/";
}
$lcd = "E:\\wwwroot\\www\\www.einfach.net\\band\\$godir";
$handle = opendir($lcd);
$files = "";
$dir = "";
while (false !== ($file = readdir ($handle)))
{
if($file != ".")
{
if(is_dir("$lcd\\$file"))
{
if($file == "..")
{
$i=0;
$ex = explode("§", $olddir);
$polddir = "";
#"
if(count($ex) == 1)
{
$polddir = "";
} else {
while($i < count($ex)-1)
{
$polddir .= $ex[$i];
if($i + 1 < count($ex)-1)
{
$polddir .= "§";
}
$i++;
}
}
if(@$HTTP_GET_VARS['dir'] != "")
{
$dir .= "zurück
\n";
}
} else {
$dir .= "$file
\n";
}
} else {
if($file != "index.php")
{
$files .= "$file
\n";
}
}
}
}
closedir($handle);
##########
#AUSGABE:#
##########
echo "Ordner:
$dir
Dateien:
$files";
?>