php - redirect after image uploaded with imagecreatefromjpeg -
i'm trying use gd library crop , upload image. upload image first server , save url image pass following script reads original uploaded image , crops according coordinate give it.
<?php $w = $h = 150; $quality = 90; $src = $_post['path']; $img = imagecreatefromjpeg($src); $kak = imagecreatetruecolor( $w, $h ); imagecopyresampled($kak,$img,0,0,$_post['x'],$_post['y'], $w,$h,$_post['w'],$_post['h']); header('content-type: image/jpeg'); imagejpeg($kak,'c.jpg',$quality); imagedestroy($img); ?>
all works fine, image upload, crop , cropped image upload. problem page empty , redirect visitor different page if add
header ("location: nextpage.php");
at end of php script redirects before finishing uploading. know how once file has been uploaded successfully?
thanks in advance
Comments
Post a Comment