PHP Effective Directory Listing
PHP
Download (.zip)
<? // The CODE below must be in .htaccess
//CODE: <FilesMatch "^index$"> //CODE: ForceType application/x-httpd-php //CODE: </FilesMatch>
//END
$a = $_SERVER['REQUEST_URI']; $b = $_SERVER['SCRIPT_NAME'];
$c = eregi_replace("$b/", "", $a);
if (is_dir($c)) { $handle = opendir($c); while($file = readdir($handle)) if ($file != "." && $file != "..") echo "$file<BR>"; } ?>
|