Jump to content

directory read inconsistent


wds

Recommended Posts

i am recently purchased a new website (humdingerphoto.com), and i've been developing a gallery script to read the directory and creat a gallery. for some reason when i run my script on this new server it doesn't register all of the files in that directory. i have broken the script down to barebones to try to figure this out b/c it doesn't make sense. i KNOW that this script works b/c i also manage my brothers website for him, and it works flawlessly on his server.

 

my host is hostmonster.com... and they said they running php 5.

 

<?

print("<html>");

$i = 0;

$dir = dir("images");

while (($dir->read()) !== false){

$file[$i] = $dir->read();

print($file[$i] . "<br>");

$i++;

}

print_r($file);

print("</html>");

?>

 

and the output for instance...

 

..

d.JPG

a.JPG

 

Array ( [0] => .. [1] => d.JPG [2] => a.JPG [3] => )

 

 

i've even changed the file names all up just to make sure i wasn't losing my mind. what it seems to do is skip the first file, then read the next, then skip one again and so on. i know it has something to do with the host and not my script, b/c i double checked it. of course tech support doesn't know anything about php, only helping you with site support.

 

 

-dave

Link to comment
https://forums.phpfreaks.com/topic/62350-directory-read-inconsistent/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.