Click to See Complete Forum and Search --> : show content of directory


liezica
07-25-2005, 07:13 AM
Hello,

I have the following problem. I want to display a number of pictures on my website who are all in the same directory 'pictures'. Because I must be able to change the pics a lot, it would be easy to have a way of just reading the directory and to show all the pics he finds.

Thanks!
Liezica

liezica
07-25-2005, 07:25 AM
Oops, I gave up looking myself to easily. I found the solution already. For those who still want to know:


<?
if ($handle = opendir('pictures'))
{
while (false !== ($file = readdir($handle))) {
echo "<img src=\"pictures/$file\">";
}

closedir($handle);
}
?>

bokeh
07-25-2005, 08:20 AM
Are the images JPEGs