<?php // Show size of each file, 1 for YES, 0 for NO $showsize = 1; // Array with file types to display and the images to use. // Syntax: $display['filetype'] = "image"; $display['php'] = "php.gif"; $display['html'] = "html.gif"; $display['htm'] = "html.gif"; $display['shtml'] = "html.gif"; // Array with directories to exclude. // Syntax: $excludedir[] = "directory"; $excludedir[] = "cgi-bin"; $excludedir[] = "images"; $excludedir[] = "realaudio"; $excludedir[] = "style"; // Array with files to exclude. // Syntax: $excludefile[] = "filename"; $excludefile[] = "phpinfo.php"; // Set some important stuff // Uncomment the 2 lines below to create a tree of all files and directories on // your webserver if the script is in a subdirectory $prefix = ""; $root .= "/"; // Display server name and directory echo "<tr><td><img align="absmiddle" src="server.gif" border="0"> <b>http://".$_SERVER['SERVER_NAME']; function get_extension($name) { return $retval; } // Recursion! And away we go... // Set some globals and clean up a bit... // What a pig... function list_dir($chdir) { // Open the current directory // Read directory. If the item is a directory, place it in $sdirs. // If it's a filetype we want, put it in $sfiles */ { { $sdirs[] = $file; } { $sfiles[] = $file; } } // Count the slashes to determine how deep we're in the directory. // Add lines to make it pretty. // Display directory names and recursively list them. for($y=0; $y<sizeof($sdirs); $y++) { for($z=1; $z<=$count; $z++) else list_dir($dir."/".$sdirs[$y]); } } // Run through the array of files and show them. // What file types shall we display? for($y=0; $y<$sizeof; $y++) { for($z=1; $z<=$count; $z++) if($y == ($sizeof -1)) else echo $display[get_extension($sfiles[$y])]; echo "" border="0"> "; // pokazuje pliki if($showsize) { } } for($z=1; $z<=$count; $z++) } } list_dir($root); // How long did that take? ?>
ładnie pokazywana jest cała struktura katalogó+podkatalogów+plików, ale problem jest taki, że np. przy plikach link jest generowany tak:
http://localhost/z:/home/localhost/www/fol...folder/plik.php
gdzie to można zmienić?