<?
if ($dir = opendir("/web/")) {
$i = 1;
while (($file = readdir($dir)) !== false) {
if (is_dir($file)) {
echo ('<B>' . $file . '</B><BR>');
} else {
$file_array[$i] = $file;
$i++;
}
}
closedir($dir);
sort($file_array);
for($c = 1; $c <= $i; $c++) {
echo($file_array[$c] . '<BR>');
}
}
?>
Hello. I have this little script which I'm working on. I am running under windows and PHP 4.3.0. The problem is that it only functions when $dir is targeted at \web. Any other folder on my Hard Disk and the folders are treated as files. The only ones in bold are "." and "..". \web is the Apache 'root' web folder - does this have anything to do with it? Any help welcome.
Domhal