## PHP code here don't edit ##
$REQUEST_URI= getenv("REQUEST_URI");
$SCRIPT_NAME= getenv("SCRIPT_NAME");
$DOCUMENT_ROOT= getenv("DOCUMENT_ROOT");
// get the folder path
$dir_name = dirname($SCRIPT_NAME);
// get the parent dir path
if (substr($REQUEST_URI,-1)=="/") {
$length= strlen($REQUEST_URI)-1;
$uripath= substr($REQUEST_URI,0,$length);
}else {
$uripath= dirname($REQUEST_URI);
}
$lastslash= strrpos($uripath,"/");
$parenturi= substr($uripath,0,$lastslash+1);
if ($parenturi=="") $parenturi= "/";
// get the picture list and do HTML code
$dir = $DOCUMENT_ROOT.$uripath;
$dir = "./";
$directory = opendir($dir);
$file_list = "";
while($file = readdir($directory)){
$file_array[] = $file;
if($file == "." ) continue;
if($file == ".htaccess" ) continue;
if($file == ".htpasswd" ) continue;
if($file == ".." ) continue;
if($file == "index.php" ) continue;
$path_parts = pathinfo($file);
$ext = strtolower($path_parts["extension"]);
// accept just images
if ($ext == "jpg" || $ext == "gif" || $ext == "png"){
// get image size
$size = getimagesize($file);
$height = $size[1];
$width = $size[0];
$file_list .= '
'.$file.' '.date ("d-F-Y H:i", filemtime($file)).'