Posted by Krustov on 10/28/06 14:00
<comp.lang.php>
<Jane>
<Sat, 28 Oct 2006 14:53:39 +0200>
<ehvjs8$er8$1@localhost.localdomain>
> I need some help (php rookie) to build a thumbnail page using php.
> I'v a mysql database containing links to the original image files.
> No thumbnails created so far.
>
> It would be nice when the thumbnail contains a link to the original file :-)
>
Its usually better to scan the folder for image files , The following
doesnt create the thumbnails for you - but it will get you started .
<?php
$batman=0;
$dir="chatroom/images";
$joker=opendir($dir);
while (false!==($boywonder=readdir($joker)))
{
$files[]=$boywonder;
$batman=$batman+1;
}
$temp=0;
while ($temp<$batman)
{
$demo=$files[$temp];
$link="$dir" . "/" . "$demo";
print "<a href=$link>$demo</a><br>";
$temp=$temp+1;
}
?>
--
www.phpchatroom.co.uk
Navigation:
[Reply to this message]
|