Having trouble grabbing an image from directory..
I want to display a thumbnail along with a title as an intro/link to a picture album.
I just want to grab an image from the direcory of images that populates the album.
I thought i've done this before... maybe my logic is off tonight!
!- my brain is fried -! this should be easy... maybe you can help.
$dir = "/home/dblsports/www/images/user_uploaded/" . $pictures['directory'];
if ($handle = opendir($dir)) {
$file = readdir($handle);
closedir($handle);
}
$img1 = $file[0];
// Print thumbnail
echo " <td><center><a href=\"http://www.dblsports.com/images/display_thumbnails.php?PIC=".$pictures['id']."&directory=".$pictures['directory']."\"><font size=\"2\" face=\"Tahoma\"><b> ".$pictures['title']."</b></font><br>
<img src=\"$img1\" heigth=\"100\" width=\"100\" border=\"0\"></a></center></td>\n";
How can I select an image -on the fly- from a directory?
Thanks,
Phence