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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.