thanks, but i have a few more questions, this will work with jpeg's right?
no...for jpeg's you have to pass a different header to the client:
header("Content-Type: image/png");
open the file with
imagecreatefromjpeg ('file.png');
and output a jpeg image:
imagejpeg ($image_resized);
showthumb.php
header("Content-Type: image/png");
$image=imagecreatefrompng ($_GET['image']);
imagecopyresized ($image_resized, $image, 0, 0, 0, 0, 100, 150, imagesx($image), $imagesy($image));
imagepng ($image_resized);
imagedestroy ($image);
imagedestroy ($image_resized);
if you now open
'/showthumb.php?image=welcome.php'
in your browser you will see a thumbnail generated...
you can treat that PHP script as a normal image in your HTML code:
echo '<a href="/images/' . $pic . '"><img src="/showthumb?image=' . urlencode($pic) . '" width="100" height="150"></a>';
WARNING: this is ment as a demonstration and does /NOT/ make any security related checks...only use it for testing...
for a reference on the functions see -> http://de3.php.net/manual/en/ref.image.php