$filename"; exec($command); // remove original bmp unlink("$filename.bmp"); // check png image by loading and saving the file // to prevent wrong uploaded files and errors $img = imagecreatefrompng($filename); imagepng($img, $filename); imagedestroy($img); // set image type to png $img_type = "PNG"; break; default: break; } // retrieve image file size $imgbytes = filesize($filename); // insert image into db mysql_query("INSERT INTO $img_table (img_file, img_type, img_height, img_width, img_bytes, img_title, img_descr, img_alt) VALUES('$uniq', '$img_type', ".$imginfo[1].", ".$imginfo[0].", $imgbytes, '".addslashes($HTTP_POST_VARS["title"])."', '". addslashes($HTTP_POST_VARS["descr"])."', '".addslashes($HTTP_POST_VARS["alt"])."');"); // display some information echo "Image uploaded.

". "URL: img.php?f($uniq)"; ?>