function dir2box($path, $name, $default="") { $result="\n"; $handle=opendir("$path"); while ($file = readdir($handle)) { if ($file == $default) {$selected="selected";} else {$selected="";} if ($file != "." and $file !="..") {$result.="$file\n";} } closedir($handle); $result.="\n"; return $result; } ?> /* example */ require("dir2box.php3"); $default="index.php3"; $path="/home/cybergl.co.id/htdocs"; ?> Files : echo dir2box($path, "directory", $default); ?>
Files : echo dir2box($path, "directory", $default); ?>