// false - don't allow switching to the parent-directory of this script
// true - allow simple switching to the parent-directory (via 'href')
$allow_parent = "false";
//configuration ends here---------------------------------------------------------------------------------------------------------------------------
//=======================================================================================
$path=$_GET["path"];
$SCRIPT_NAME=getenv("SCRIPT_NAME");
//put directory content in arrays-----------------------------------------------------------------------------------------------------------------
if (!isset($path)) { $path = "./"; }
if (!file_exists($path)) { echo "
File not found!
"; exit; }if (strstr($path,"..")) { echo "
invalid path!
"; exit; }$base_dir = getcwd();
if ($path=="/") { $path = "./"; }
chdir($path);
$current_dir = getcwd();
$directory = dir("./");
$directories_array = array();
$files_array = array();
while ($file = $directory->read()) {
if (is_dir($file) AND $file != ".") { $directories_array[] = $file; }
if (is_file($file)) { $files_array[] = $file; }
}
$directory->close();
//sort and output the arrays-----------------------------------------------------------------------------------------------------------------------
echo "
Directory listing for ".basename($current_dir)."
";echo "
| Name | Size | Date |
|---|---|---|
| $value/ | ".gmdate("d M Y H:i",filemtime($value))." | |
| $value/ | ".gmdate("d M Y H:i",filemtime($value))." | |
| $value | $filesize | ".gmdate("d M Y H:i",filemtime($value))." |
?>
Copyright Ayon Baidya
No comments:
Post a Comment