Here's something I used for a quick equivalent of unix's find.
PHP Code:
function scanDir2($workdir, $startdir) {
$workdir = "$startdir/$workdir";
echo("<UL>\n");
$DIR = opendir("$workdir");
while($tmpname = readdir($DIR)) {
if (preg_match('/^\.+/', $tmpname) == true) {
next;
}
elseif (is_dir("$workdir/$tmpname")) {
echo("<LI>\n");
scanDir2("$wordir$tmpname", $workdir);
echo("</LI>\n");
}
else {
echo("<LI>$tmpname</LI>\n");
}
}
closedir($DIR);
echo("</UL>\n");
}
At the end you get a bunch of nested unordered lists. You would have to change this to selects and full paths insead of nested lists but the principle is the same.