hello i've been trying to accomlish open a dir and then if there is a dir in that to open it and keep going until all dirs are open. (hopfully this makes some sense).
This is as far as i got: (sorry if it's a bit messy)
<?php
}
$url = explode("/", $PHP_SELF);
$file = $url[sizeof($url)-1];
$dir = $url[sizeof($url)-2];
$dirpath = "/home/aow/cgi-bin/";
echo "<b>$file</b> in <b>$dir</b>";
// OpenDirPath function
function OpenDirPath($path)
{
$handle = opendir($path);
$ass = str_replace("/home/aow/cgi-bin/", "", $path);
while (false !== ($file = readdir($handle)))
if ($file != "." && $file != "..") {
echo "<li><a href=\"$ass$file\">$file</a>\n";
}
closedir($handle);
}
echo "<ul>\n";
if ($dir = @opendir("$dirpath")) {
while (false !== ($file = readdir($dir))) {
if ($file != "." && $file != "..") {
if (is_dir($file)) {
echo "<li><b>$file</b>\n";
echo "<ul>\n";
OpenDirPath("/home/aow/cgi-bin/$file/");
echo "</ul>\n\n";
} else {
echo "<li><a href=\"$file\">$file</a>";
}
}
}
closedir($dir);
}
echo "</ul>\n";
?>
Could someone please help me with this?
Thank you,
taylor