HoT Web Sites List In Megrisoft Network, Internet Sites, Links

method=post>    

"; echo " http://$SERVER_NAME$prefix/"; function list_dir($chdir) { global $root, $display, $prefix, $PHP_SELF; unset($sdirs); unset($sfiles); chdir($chdir); //delete all files from previous runs not to mess up the script with the old data, determine the path of the desired working directory and switch to it $self = basename($PHP_SELF); $handle = opendir('.'); while (false !== ($file = readdir($handle))) { if(is_dir($file) && $file != "." && $file != "..") { $sdirs[] = $file; } elseif(is_file($file) && $file != "$self" && ereg("(php|htm|html|shtml)$", $file)) { $sfiles[] = $file; } } //read the content of the directory, save directories, PHP and HTML files (except the script itself) $dir = getcwd(); $dir1 = str_replace($root, "", $dir); $count = substr_count($dir1, "/") + substr_count($dir1, "\\"); //determine the number of subdirectories we're in to be able to add the appropriate number of |s before the directory name if(is_array($sdirs)) { sort($sdirs); reset($sdirs); for($y=0; $y"; for($z=1; $z<=$count; $z++) { echo "   "; } if(is_array($sfiles)) { echo ""; } else { echo ""; } echo " $sdirs[$y]"; $cwd1[0] = $dir; $cwd1[1] = $sdirs[$y]; $chdir = join("/", $cwd1); list_dir($chdir); //call the script itself in all directories found to recursively read all subdirectories } } //if directories were found, display them in a tree chdir($chdir); //change back to the directory the files are in, we need to do this because in the loop above we've read all subdirectories and therefore changed the working directory if(is_array($sfiles)) { sort($sfiles); reset($sfiles); if(!isset($display)) { $display = "both"; } $sizeof = sizeof($sfiles); for($y=0; $y<$sizeof; $y++) { if(ereg("php$", $sfiles[$y]) && ($display == "both" || $display == "PHP")) { echo ""; for($z=1; $z<=$count; $z++) { echo "   "; } if($y == ($sizeof -1)) { echo ""; } else { echo ""; } echo " "; echo "$sfiles[$y]"; } elseif(ereg("(html|htm|shtml)$", $sfiles[$y]) && ($display == "both" || $display == "HTML")) { echo ""; for($z=1; $z<=$count; $z++) { echo "   "; } if($y == ($sizeof -1)) { echo ""; } else { echo ""; } echo " "; echo "$sfiles[$y]"; } } echo ""; //check which files to display and display them for($z=1; $z<=$count; $z++) { echo "   "; } echo ""; } //now display the files in the directory with links to themselves } //We defined this function because we needed a script that calls itself recursively to read all subdirectories on the server. Now we just need to call it. list_dir($root); echo ""; $ftime = gettimeofday(); $time = round(($ftime[sec] + $ftime[usec] / 1000000) - ($stime[sec] + $stime[usec] / 1000000), 5); echo "

This page was generated in $time seconds.
"; ?>