'; ?>
\n\t"; echo "\n\t"; echo "\n\t"; echo "\n\t"; } // don't show hidden files else { // link this section to directory echo " "; echo ""; echo $val; echo "\n\t"; echo "\n\t"; echo "\n\t"; // return to home chdir($dir); } } // increment number of directories $count++; } // end while closedir($dh); } // end open dir // make sure there were files if($count == 0) { echo ""; } // resent count $count = 0; echo ""; // find files matching pattern $files = glob($filePattern); // sort the files asort($files); // iterate over files array and print filenames foreach ($files as $filename) { // if filename is not a direcroty, or this file or a hidden file if (!is_dir($filename) && $filename != "index.php" && strncmp(".",$filename,1)!=0) { $count++; // write html // open row and left div echo "\n\t"; echo "\n\t"; echo ""; echo "\n\t"; echo "\n\t"; } // end if not dir // return to home chdir($dir); } // end for each // make sure there were files if($count == 0) { echo ""; } ?>
Directoriessample contents
\n\t"; if($val == "..") { // link this section to directory echo " "; echo ""; echo "$val Parent Directory"; echo "
\n\t"; // go into the requested dir chdir($dir . "/" . $val); // and find files matching pattern $infiles = glob($filePattern); // list the first 3 file names echo $infiles[0] . ";\n\t "; echo $infiles[1] . ";\n\t "; echo $infiles[2] . " ...\n\t"; echo "
no directories
FilessizeLast Modified
\n\t"; // link this section to directory echo " "; echo ""; echo $filename; echo ""; echo "" . round(filesize($filename)/(int)1048576,2) . " Mb" . date("F d Y H:i:s.", filemtime($filename)) . "
no files