I list a directory with the following code...
<h1>Begin</h1>
<?
$d="/home/w33els/www/test";
if ($dir = opendir($d)) {
while($file = readdir($dir)) {
echo "$file<br>";
}
closedir($dir);
}
echo "<br><br>Time indicator : ".time();
?>
<h1>End</h1>
This works fine, but if I click refresh soon after I get...
Warning: 1 is not a valid Directory resource in /home/w33els/www/dir.php on line 15
Note, line 15 is...
while($file = readdir($dir)) {
If I wait a while before refreshing it works as normal.
The above directory has permision 755 and is on a hosted ISP.
This can be seen at...
http://www.w33els.com/dir.php
Linux/Apache
Works fine on my local Win2000/Apache
It's driving me crazy, any help appreciated.