< Main PHP FILE (dirlist.php3) >
$url_address = "http://130.113.48.245";
$local_address = "d:/Server";
$relative_address = str_replace( '%20', ' ', $QUERY_STRING );
$listing_title = "In responce to: $local_address/$relative_address";
require "darklib.inc";
heather($listing_title);
record_user();
$fp = opendir("$local_address/$relative_address");
while ($file = readdir($fp))
if (filetype($local_address . "/" . $relative_address.$file) == file) {
$Ufiles[] = $file;
$Lfiles[] = strtolower($file);
} else {
$Ufolders[] = $file;
$Lfolders[] = strtolower($file);
}
closedir($fp);
sort($Lfolders);
for ($i=0; $i<=count($Lfolders)-1; $i++) {
for ($j=0; $j<=count($Lfolders)-1; $j++) {
if (strcmp($Lfolders[$i], strtolower($Ufolders[$j])) == 0) {
$folders[] = $Ufolders[$j];
}
}
}
for ($i=0; $i<=count($folders)-1; $i++)
$item[] = $folders[$i];
if (count($Lfiles) > 0) {
sort($Lfiles);
for ($i=0; $i<=count($Lfiles)-1; $i++) {
for ($j=0; $j<=count($Lfiles)-1; $j++) {
if (strcmp($Lfiles[$i], strtolower($Ufiles[$j])) == 0) {
$files[] = $Ufiles[$j];
}
}
}
for ($i=0; $i<=count($files)-1; $i++)
$item[] = $files[$i];
}
for ($i=0; $i<=count($item)-1; $i++) {
if (strcmp($item[$i], "..") != 0 && strcmp($item[$i], ".") != 0) {
if (filetype($local_address."/".$relative_address.$item[$i]) == file) {
$filesize = number_format(filesize($local_address."/".$relative_address.$item
[$i])/1024)." kb";
echo "";
$icon_file = iconcalc($item[$i]);
echo "src=/Icons/$icon_file height=17 width=16 border=0> ";
echo "$item[$i]
";
echo "$filesize ";
echo "File ";
} else {
$filesize = "Directory";
echo " ";
echo "[$i]/\"> ";
echo "[$i]/\">$item[$i] ";
echo " ";
echo "Folder ";
}
}
}
echo "";
echo "";
echo "
";
echo " ";
echo "";
?>