I have been using this code to search a directory for files and display them as links but I want to search all the directories on my site and display the files. How would I edit my code to do this?
<?php
$dh = opendir("D:\wwwroot");
$filename = $_POST["directory"];
while (!(($file = readdir($dh))===false)){
if(stristr($file, $filename)){
if(strstr($file, ".")){
echo'<a href="'.wwwroot.'/'.$file.'">'.$file.'</a><br>';
}
}
}
closedir($dh);
?>
Thanx in advance.


