Hi PHP expert pls help a friend. I am working with php and mysql, building a music site,
I am getting an issue with the image form of the site, if i leave the image form empty and submit the form, it create a blank black thumb, and save it as image, instead to leave the form empty since i did not filled it.
I checked the code and found some image code of resizing the image if needed which i suggest that their the ones, making this issue but i am not sure.
Here ia the code please some one should help me and fixed it Here is the code in pastebin
if(isset($_POST['submit']) and isset($_GET['add']))
{
$artist_image=rand(0,99999)."_artist.jpg";
//Main Image
$tpath1='thumbs/orginal/'.$artist_image;
$pic1=compress_image($_FILES["artist_image"]["tmp_name"], $tpath1, 85);
//Thumb Image
$thumbpath='thumbs/300/'.$artist_image;
$thumb_pic1=create_thumb_image($tpath1,$thumbpath,'300','300');
$thumbpath2='thumbs/100/'.$artist_image;
$thumb_pic2=create_thumb_image($tpath1,$thumbpath2,'100','100');
$artistlink = convert_link($_POST['artist_name']);
$data = array(
'artist_name' => $_POST['artist_name'],
'artist_image' => $artist_image,
'artist_link' => $artistlink
);
$qry = Insert('tbl_artist',$data);