note 56617 deleted from function.apache-request-headers by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Jun 2009 18:49:40 +0000 |
| Subject: | note 56617 deleted from function.apache-request-headers by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156485@lists.php.net to get a copy of this message | ||
Note Submitter: php [at] barryhunter [.] co [.] uk
----
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.