First of all, you would NEED GD - you cannot manipulate images using PHP without GD library. Once you have GD, take a look at the code below.
I borrowed code from one of the other posts:
http://www.phpbuilder.com/forum/read.php3?num=2&id=113983&loc=0&thread=113983
I have made some modifications to make sure the thumbnail doesn't get stretched wide or tall (if the original image it rectangular) and still fits in a table cell of, say 48x48 pixels. I havent tested the code, but should work if you are using it on the fly.
function resizejpg($imagefile)
{
$src_img = imagecreatefromjpeg($imagefile);
$old_w = imagesx($src_img);
$old_h = imagesy($src_img);
if ($old_w < $old_h) {
$new_w = 48 $old_w / $old_h;
$new_h = 48;
} else
{
$new_w = 48;
$new_h = 48 $old_h / $old_w;
}
$dst_img = imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$old_w,$old_h);
imagejpeg($dst_img);
ImageDestroy($src_img);
ImageDestroy($dst_img);
}