Hi!
Thanks a lot.
I tried the script it list the file fine in the current directory, but it doent seem to list the files in the subfolder and when u click it . It doenst seem to open the right files.
I tied another way of listing the file and the files in the subfolder..
It list the file fine in the current folders and subfolder
but when u click on the links for the files in the subfolder..
doesnt seem to work.. 🙁
any suggestion examples
Thank a lot in advance
$username ="somename";
$path = "/dir/$username/"; // relative path
$pathHref = "/$username/"; // relative path
function traverse_dir($dir,$pathHref) {
echo "Traversing $dir ...<br>";
echo "pathHref $pathHref ...<br>";
chdir($dir);
if(!($dp = opendir($dir))) dir ("Can't open $dir");
while($file = readdir($dp)) {
if(is_dir($file)) {
if($file != '.' && $file != '..') {
PRINT "/$file<BR>";
traverse_dir("$dir/$file",$pathHref);
chdir($dir);
}
}
else echo "---- ><a href=\"$pathHref$file\">$file</a><br>";
}
closedir($dp);
}
traverse_dir($path,$pathHref);