this is the code i use to fetch info from database is there a way to limit the size of the photo to a certain size to display //Outputs the image and other data Echo "<img src=http://www.caravan-holiday-exchange.com/images/".$info['photo'] ."> <br>"; Echo "<b>Park Name:</b> ".$info['parkname'] . " <br>"; Echo "<b>Park Location:</b> ".$info['parklocation'] . " <br>"; Echo "<b>Details:</b> ".$info['caravandetails'] . " <hr>"; PHP: cheers Doug
use the gd2 library. it'd be better if you saved the images resized when uploaded but if you want to do it when the page loads then use something like this <?php $imagepath = $_GET['image']; $myHeight = 100; $myWidth = 100; if(file_exists($imagepath)){ $size = getimagesize($imagepath); $source_x = $size[0]; $source_y = $size[1]; $source_id = imagecreatefromjpeg($imagepath); $target_id = imagecreatetruecolor($myWidth, $myHeight); $target_pic = imagecopyresampled($target_id, $source_id, 0, 0, 0, 0, $myWidth, $myHeight, $source_x, $source_y); imagejpeg($target_id); } //lets assume that this file is named "thumbnail.php" //in another file, <img src="thumbnail.php?image=myimage.jpg" alt="thumbnail" /> ?> PHP: