...

View Full Version : Showing All Images in A Directory



CoolAsCarlito
08-11-2008, 04: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?

mlseim
08-11-2008, 05: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:
http://www.google.com/search?hl=en&q=php+show+all+photos+in+a+directory&btnG=Google+Search

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:
http://us.php.net/readdir



.

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



<?php
print_r(scandir("images"));
?>


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?

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

They show an alternative method for PHP4:
http://us.php.net/manual/en/function.scandir.php



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum