Surly this could be rewritten as
function list_dirs($path, $target)
{
$list = scandir($path);
$url = $_SERVER['HTTP_HOST'];
foreach ($list as $number => $filename)
{
if ( $filename !== '.' && $filename !== '..' && !is_file($filename) )
{
if ($target == '')
{
// Print Dirs with link
print ("<a href=\"http://$url/$filename\">$filename</a> <br>\n");
}
else
{
// Print Dirs with link
print ("<a href=\"http://$url/$filename\" target=\"$target\">$filename</a> <br>\n");
}
}
}
}
which would then not require apache. I havent tested this but looks to do exactly the same.




















