I have the following code which displays a cropped image on the screen, but I would like this image to automatically download as well as display on screen.
The file name can be anything random.
$targ_w = 800;
$targ_h = 600;
$jpeg_quality = 80;
$vImg = @imagecreatefromjpeg($_FILES['image_file']['tmp_name']);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
imagecopyresampled($dst_r,$vImg,0,0,$_POST['x'],$_POST['y'],$targ_w,$targ_h,$_POST['w'],$_POST['h']);
header('Content-type: image/jpeg');
imagejpeg($dst_r,null,$jpeg_quality);