I am a beginner in php and i am trying to crop an image.But not getting cropped output
steps i did:
1. uploaded an image using php to a Database.
2. on click on of crop link it taakes me to new page crop_img.php
3.here i have used jcrop ( but not working)
code:
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if($_GET['id'])
{
$lid=$_GET['id'];
unlink($lid);
}
$image=mysql_query("SELECT * from image where id=$lid");
$targ_w = $targ_h = 150;
$jpeg_quality = 90;
$img= '<img src=get_crop.php?id=$lid />'; //feel error is here//
$img_r = imagecreatefromjpeg($img);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
imagecopyresampled($dst_r,$img_r,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);
exit;
}?>
// form inside body//
<form action="crop_img.php" method="post" onsubmit="return checkCoords();">
<input type="hidden" id="x" name="x" />
<input type="hidden" id="y" name="y" />
<input type="hidden" id="w" name="w" />
<input type="hidden" id="h" name="h" />
<input type="submit" value="Crop Image" />
</form>
please help


