readdir() & PWS & 4.0.1
| From: | Data Driven Design | Date: | Thu, 29 Jun 2000 12:50:55 +0000 |
| Subject: | readdir() & PWS & 4.0.1 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3789@lists.php.net to get a copy of this message | ||
I just did a clean install of Windows ME, and downloaded PHP 4.0.1, and I'm
using isapi on PWS. I get the following error ... sometimes, when using the
script that follows which I've used in many places. It makes a menu.
Warning: 1 is not a valid Directory resource in C:\Work\index.php on line 22
<BODY>
<h1>Welcome to Administration Page</h1>
<h3>Choose an Option<ul>
<?php
// open directory
$directoryName = ".";
$myDir = opendir($directoryName) or die($php_errormsg);;
// get each listing
while($file_in_dir = readdir($myDir)) {
if (!(($file_in_dir == ".") || ($file_in_dir == "..") || ($file_in_dir ==
"index.php"))) {
$temp = $file_in_dir;
$temp = eregi_replace(".php","",$temp);
$temp = eregi_replace("pg_","",$temp);
print "<li>\n<a href=\"$file_in_dir\">" . filetype($temp) . "
-
$temp</a>\n";
}
}
?>
</ul>
</BODY>
Is this a PHP problem or a PWS problem?
line 22 is the readdir() line.
Data Driven Design
P.O. Box 1084
Holly Hill, FL 32125-1084
Phone : (904) - 226-8979
URL : http://www.datadrivendesign.com
URL : http://www.rossidesigns.net