Yay 😃 It works well.
I added my own bit of code, taken from the first post that stopped it showing the '.' and '..'.
if ($handle = opendir($path)) { // create a file handle and open a directory
while (false !== ($fileordir = readdir($handle))) {
// $fileordir now contains a single name of a file or directory in $path
// loop until we've read them all
if (is_dir("$path/$fileordir"))
if($fileordir== ".." || $fileordir== ".")
{ continue; }
echo $fileordir;
// BINGO (watch out for '.' and '..')
}
closedir($handle); // clean up
}
I added my own little bit of code at the beggining of the page so that you can 'browse' the directory.
You click the folder and it adds a ?dir=directory at the end. I'll update the code on this page when i get a chance to see the code again.