$dir="./item/"; $PicUser = $_POST['userfile']; if (!empty($PicUser)) { $imgarr=getimagesize($PicUser); echo $imgarr; $imgarr=array("100","100","2"); if ($imgarr[0] <= 300 AND $imgarr[1] <= 300) { $id=@mysql_result(@mysql_query("select id from shop_item order by id desc"),0,0); if (!is_uploaded_file ($PicUser)) { $error_teks=" couldn't be copied !!"; } if (is_uploaded_file ($PicUser)) { $desfile="shop_$id.jpg"; move_uploaded_file($PicUser,$dir.$desfile) ; } copy($PicUser, "item/shop_$id.jpg"); $image="item/shop_$id.jpg"; mysql_query("update shop_item set picture='$image' where id='$id'"); } else { $error_teks="Can not upload file . Maximum size is 300x300"; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)