View Single Post
Old 12-10-2007, 05:26 AM   #8 (permalink)
/\/\ongoose
The Wanderer
 
Join Date: Nov 2007
Posts: 22
Thanks: 0
/\/\ongoose is on a distinguished road
Default

Quote:
Originally Posted by Haris View Post
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..
That ouputs a syntax error
/\/\ongoose is offline  
Reply With Quote