View Single Post
Old 12-10-2007, 05:15 AM   #6 (permalink)
Haris
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default

You can use a function called glob(). It uses a pattern to search for the required files. If all you have in that directory are images, you can use the following:

http://php.net/glob

php Code:
<?php
foreach (glob("*") as $szFilename) {
    echo '<img src="' . $szFilename . '" alt="Image" />';
}
?>

Database would be overkill for a simple thing like this which can be achieved using one function unless you want to output more information regarding the file like titles, short description, tags and much more..
Haris is offline  
Reply With Quote