PHP contents of folder
Hi,
I'm trying to print a list of files that are located in sub, sub folders.
and my directory.php page is at site root level.
Sitename:
+fee
+fi
+foo
file1
file2
file3, etc...
directory.php
The code I'm using works great at producing a list of links. But when you click on links to files, the paths are all wrong and I'm getting 404 errors.
<?php
$dir = "fee/fi/foo";
$dh = opendir($dir);
while (false !== ($filename = readdir($dh)))
{
if($filename!='.'&&$filename!='..')
$files[] = $filename;
}
sort($files);
foreach($files as $value) echo "<a href='{$value}'>{$value}</a><br/>";
?>
What am I missing?
Thanks,
Nancy O.
