function scanDir($dirPath) {
$my_dir = openDir($dirPath);
while ($my_file = readDir($my_dir)) {
if (is_dir($dirPath."/".$my_file) and $my_file != "."and $my_file != ".." and $my_file != "devFileUploader") {
$dirs[] = $dirPath."/".$my_file;
$sub_dirs = scanDir($dirPath."/".$my_file);
$dirs = array_merge($dirs,$sub_dirs);
}
}
return $dirs;
}
$dirs = scanDir(".");
echo "<select name=\"upload_dir\" style=\"width: 390px;\">";
foreach ($dirs as $dir_path) {
echo "<option value=\"".str_replace("../","",$dir_path)."\">".str_replace("../","/",$dir_path)."</option>";
}
echo "</select>";
Thought I'd written something to do this before.. and I have!