php help

Got a major favour for all you php guys out there, now I've asked before for a dynamic sig, which i still have the php code for.. but i need something maybe a bit more advanced.. see if you guys could help me out on this one..

I'm after

"Write relevant HTML web pages and PHP to view a catalogue of images (Gif or JPEG format) stored in an image subdirectory. You should provide a simple means of selecting an imagine file and then, upon selection, the image will be displayed on a web page together with the chance to select another image

The list of files should be dynamic - your CGI script should be able to provide a list of the current contents of the image directory at any time"

Now, The current dynamic code i've got is handy; because it will load, dynmically, a random image from the folder on each refresh, but i need to do all of the above, and it's proving tricky - anyone about who knows what their doing would be awesome

Is an allready written PHP script which is rather easy to understand, see if you can get some ideas from them as to how to do it (Do note, DO NOT COPY AND PASTE, the code is under the GPL, and you would be infringing)

the way I would do it is first open the directory (fopen can do this I believe) then using a loop check each file within the directory to make sure its an image (getimagesize would be good here). You can either output the images at this point or add them to an array for use in outputting the page then.

you would need some input parameters in order to show a specific image, but if you show the image at the top, then below that show the array of images again.

That should work, a friend of mine uses that kind of process for his rather simple picture gallery.

the way I would do it is first open the directory (fopen can do this I believe) then using a loop check each file within the directory to make sure its an image (getimagesize would be good here). You can either output the images at this point or add them to an array for use in outputting the page then.

you would need some input parameters in order to show a specific image, but if you show the image at the top, then below that show the array of images again.

That should work, a friend of mine uses that kind of process for his rather simple picture gallery.