view all .jpg files in a directory with php

I’m trying to create a Photo Gallery for my site with PHP and MySQL, and I don’t know how to write the php script to select every .jpg file from a directory on the server! Could somebody help me!?

To start with read up on http://us2.php.net/dir . That should give you what you need to get you going. When you have a code sample that won’t work just right, then come back and post it and we will try and help.

Please don’t ask us to write your script for you. Give us something to HELP you with.

Hmmm - maybe glob()…

“A script, A script - My kingdom for a script” ;)

Sponsor our Newsletter | Privacy Policy | Terms of Service