I am trying to use PHP to list the files in a directory on the server. I am trying this on a Windows 2003 Server and the directory I am trying to list the files in has full permissions set (so my problem shouldnt be NTFS permissions related).
The following code does not work and produces a warning...
Warning: opendir(C:!Webs\site\test.php ) [function.opendir]: failed to open dir: Invalid argument in C:!Webs\site\test.php on line 6
Below is the code I am using. I go this right of the PHP Programming for Windows book.
$directoryinfo = "C:\!Webs\site\pages\files\";
$dirtoread = opendir($directoryinfo); //this is line 6 in my code
while(false !==($info = readdir($dirtoread))) {
print("$info<br>");
}
closedir($dirtoread);
Any help getting this to work would be greatly appreciated.
After I get it to list the files in the directory I need to make each filename a hyperlink to the file on the server.