View Full Version : Showing All Images in A Directory

08-11-2008, 05:10 PM
Okay I want my photos.php file to show all the photos I have in my /kowphotos/ directory on my server. How do I go out having that done?

08-11-2008, 06:52 PM
I'm not trying to be a "smart-alec", but I do want to show you how to
save a ton of time ... asking questions on the forum takes a while to
get an answer.

Instead, use Google and ask the question like this:

You'll find several examples to show only images, or any filetype.

If you use Google like that, with a "PHP" in front and some function or term to find,
it will usually come up with actual PHP code examples.

This is one of the best resources ... look at some examples they have:


08-12-2008, 04:48 PM
Well I found this code :


And it gave me this error:

Fatal error: Call to undefined function: scandir() in /home/content/y/a/n/yankeefaninkc/html/photos.php on line 4

Why is that?

08-12-2008, 07:16 PM
Maybe you don't have PHP5 ... But are running PHP4?

They show an alternative method for PHP4: