PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi Everyone been a while since I Posted! I am running a very simple gallery script but there is a few errors in the code that I am having problems working out. The first problem is it won't display the correct amount of images. If I want to display 9 images I have to set the variable at 11. Second the next link is always there and continues to count up and up and up
anyhelp with this script would be very much appreciated
Besides a little reformatting so I can read it I made a minor change to your handling of $a. You were incrementing $a even when you got a . or .. and this caused your counts to be off by 2. Now $a is incremented only when the file is in the range you select or isn't in the range but is not a directory identifier.
The next was easy. $a is (in theory) the max number of files in the directory when you are done looping so you just change your test to see if $stop <= $a.