• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

php help

#1
Hey guys,

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 :)

Thanks

-Wraith
 
Last edited:
#6
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.
 

X-Istence

*
Political User
#7
Geffy said:
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.

How'd you do it for: http://geffy.co.uk/gallery/harcourt_place/?
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,013
Latest member
Pdawgintown