I'm running some code on a system running IIS and it is working as long as you are in the same directory as the script:
if ($dir = @opendir(".")) {
while (($file = readdir($dir)) !== false) {
if(is_file($file)){
print $file."<br>\n";
}
}
closedir($dir);
}
However, if I chante the opendir directory path to something else, such as the following:
$dir = @opendir("/images"))
or $dir = @opendir("images/"))
or $dir = @opendir("./images/"))
I get the following errors:
Warning: stat failed for images.gif (errno=2 - No such file or directory)
It finds the files in the directory I'm pointing to, but the is_file command is not being able to run.. is this some sort of permissions problem, or is there a particular way I need to point to the directory.. I'm used to PHP on Unix/Linux so Windows and IIS is somewhat new.
We're working on a very critical application so any help would be greatly appreciated.
Thanks!
Charles