if ($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg") {
$sql2="select max(pl_no) from prod_list";
$result2=mysql_db_query($dbname,$sql2);
$r=mysql_fetch_array($result2);
$id_max=$r[0];
$photoname=$id_max.'.'.$lastname;
copy($fileupload,"photo/".$photoname);
$img=imagecreatefromjpeg("photo/".$photoname);
$color_blue=imagecolorallocate($img,255,195,80);
imagestring($img,7,20,100,"Design by ovokid.com",$color_blue); imagestring($img,7,20,260,"Design by ovokid.com",$color_blue); imagestring($img,7,20,420,"Design by ovokid.com",$color_blue); imagestring($img,7,220,100,"Design by ovokid.com",$color_blue); imagestring($img,7,220,260,"Design by ovokid.com",$color_blue); imagestring($img,7,220,420,"Design by ovokid.com",$color_blue);
ob_start();
imagepng($img);
$i=ob_get_clean();
$fp=fopen("photo/".$photoname,'w');
fwrite($fp,$i);
fclose($fp);
$sql3="update prod_list set pl_prod_pic='$photoname' where pl_no='$r[0]'";
$result3=mysql_db_query($dbname,$sql3);
}
unlink($fileupload);
}