Really Simple Folder Browser
Script last updated on February 17, 2007 3:56pm by !nucleo.
This is a very simple folder browser. I needed to make it to display a directory of clientel folders, but I didn't want it to be able to show directory contents past the first folder like the Nucleocide File Browser.
It's only 15 lines, barely worth being called a script. Here's the source:
<font face="verdana, arial" size="1">
<?
$directory = './'; # starting directory, don't forget the slash
$dir = opendir($directory); # opens our current directory
$dl = array();
while ($f = readdir($dir)) { # read the folder
if ($f[0] != '.' && is_dir($f))
$dl[] = $f; # only add to list if they are directories
}
asort($dl); # alphabetize
echo "<b>" . sizeof($dl) . " Folders:</b><br />\n";
foreach ($dl as $f) # echo the list of links to folders
echo "<a href=\"$directory$f\">$f</a><br />\n";
?>
</font>
Alternatively, you can download it here.




