Page 1 of 1

viewing pictures

Posted: Mon Oct 15, 2007 12:20 pm
by packetsmacker
I am new to php. I currently only have one goal for learning php. that is to build a web site for sharing pictures with my family. so here is my questions.

Is there a way to have php look at the contents of a folder and display the images dynamically? What I mean by dynamically is i don't want to upload pics via a web interface. I want to ftp pics to a folder and have the page display the contents of the folder. I know there are details I will need to look into to actually get this to work. I just want to know if it is possible and where i should start. I hope this make sense. I have a lot of pic and the past solutions i have tried required me to upload pics individually.

Posted: Mon Oct 15, 2007 12:30 pm
by shannah
Try Coppermine (http://coppermine-gallery.net/). It allows you to upload a bunch of photos at once in a zip file, then it handles the rest.
It uses PHP/MySQL.

Of course if you want to do it yourself, it isn't hard to list the files in a directory and display the output in <img> tags.

see http://ca3.php.net/readdir for some examples of reading the files in directory.

-Steve

Posted: Mon Oct 15, 2007 12:55 pm
by pickle
Gallery is another and (I believe) more popular image gallery program: http://gallery.menalto.com/ . One of the nice things about Coppermine or Gallery is the fact that they do thumbnails for your for easier browsing. If you're just new to this whole thing, do a Google for "PHP gallery program" or something along those lines. Gallery is quite a large program, so you might be able to find something more lightweight for your needs.

However, ~shannah is correct - it will be fairly trivial to just do a raw dump of the images to the screen, if you're more interested in doing it yourself.

Posted: Mon Oct 15, 2007 12:59 pm
by packetsmacker
Thanks

I will have to download coppermine and see if i like it. the demo on there site looked good. I also checked the link for doing it myself. If coppermine will not work for me i have a good starting point.