You are here : Public folder/'.$subdir.'
'; } else { $subdirs = explode("/", $subdir); $parentdirs = ""; echo 'You are here : Public folder/'; foreach ($subdirs as $value) { echo ''.$value.'/'; $parentdirs .= $value.'/'; } echo '
'; } } Else { $dir=opendir('.'); //if you want to track the contents of another folder, replace the above line with //something like $dir=opendir('./MyFolder/'); } $oneOrMoreDir = false; $dirList = ""; $oneOrMoreFile = false; $fileList = ""; echo "The following folders and files contain useful things. Help yourselves.
"; while (false !== ($file = readdir($dir))){ if($file !='.' && $file != '..' && $file != 'index.php' && $file != 'index.htm' && $file != 'index.html' && $file !='.htaccess'){ //each directory listing contains: //an entry with one dot (for current directory), //an entry two dots (for parent directory), //files... //This script is probably named 'index.php' so it's better to skip index files altogether. //For security reason, '.htaccess' files also need not to be displayed. if (!strrchr($file, ".")) { //is_file or is_dir wouldn't work with my host, so I resorted to tracking dots. $oneOrMoreDir = true; If (isset($subdir)) { $dirList .= 'Script created by Goulven CHAMPENOIS.