On Sat, 2007-03-03 at 11:02 +0100, Alain Roger wrote: > I know how to do that for 1 picture. But i want to display the pictures as > thumbnail... so several pictures on the same PHP pages, with some texts. > therefore, your solution does not correspond to what i need. You need two scripts. One script that contains the <img> tags to your thumbnails, and another script that creates the thumbnails (possiblies caches them), sets the appropriate header (Content-Type: image/xxx -- where xx is png or jpeg or gif or ...) and then flushes the image binary content to the browser. You will also need to make use of the image functions in PHP to create your thumbnail. Here are some links: http://ca.php.net/manual/en/function.header.php http://ca.php.net/manual/en/function.imagecreatefromstring.php http://ca.php.net/manual/en/function.imagecopyresampled.php Let say you create two scripts... gallery.php and showImage.php. Then gallery.php will output content something like: <html> <head></head> <body> <img src="showImage.php?id=123&width=60&height=60&hash=KJHDKJHDKJHKDJHDJKHDKJHDJK" /> <img src="showImage.php?id=124&width=60&height=60&hash=KJHDKJHDKJHKDJHDJKHDKJHDJK" /> <img src="showImage.php?id=125&width=60&height=60&hash=KJHDKJHDKJHKDJHDJKHDKJHDJK" /> <img src="showImage.php?id=126&width=60&height=60&hash=KJHDKJHDKJHKDJHDJKHDKJHDJK" /> </body> </html> This way you can provide the dimension information to the showImage.php script as width and height and it can create a thumbnail with those constraints. I always ad a hash for that kind of script so that users can't arbitrarily load images at any size they want. The hash is usually an md5() hash of the id, width, height, and some private salt string. This also makes it unlikely they could load an arbitrary image ID. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php