png images issue

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Feb 01, 2011 8:50 am

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;



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

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




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

$isProcess = false;



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

$isProcess = false;


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


$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);

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 3 guests