Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

png images issue

images php coding issues or problems here.

Moderators: macek, egami, gesf

png images issue

Postby jvtest » Tue Feb 01, 2011 8:57 am

i am using the php code for png image uploading but in the displaying page the image background will shown black background
$images = $_FILES['prd_image']['name'];


$FilePaths = $_FILES['prd_image']['tmp_name'];


$ext = strtolower(substr($images,strlen($images)-3,3));


if (preg_match("/(jpg|gif|png|bmp)/",$ext))


{


$newFilename = $rend.".".$ext;


$cropB="../productsimg/big/".$newFilename;


$cropS="../productsimg/small/".$newFilename;





$object = createThumbnail($FilePaths, $cropS,120,120);


$object = createThumbnail($FilePaths, $cropB,400,632);


}


else


{


$err[] = "Invalid image format. Upload (jpg,gif,png,bmp) only";


$isProcess = false;


}


}else{


$err[] = "Select a product Image";


$isProcess = false;


}





$prd_desc = trim($_REQUEST['description']);





if($isProcess){


$insert_qry = "insert into category(prd_cat_name,prd_title,prd_sub_title,prd_cat_desc,prd_price,prd_image,created_date,company_id) values('".mysql_real_escape_string($prd_cat)."','".mysql_real_escape_string($prd_title)."','".mysql_real_escape_string($prd_sub_title)."','".mysql_real_escape_string($prd_desc)."','".mysql_real_escape_string($prd_price)."','".mysql_real_escape_string($newFilename)."',now(),$company)";


$insert_rst = mysql_query($insert_qry);
jvtest
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Feb 01, 2011 8:50 am

Return to PHP coding => Images

Who is online

Users browsing this forum: Bing [Bot] and 6 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron