Hi,
I'm trying to echo an else statement or something, which returns a thankyou if the user decides NOT to update an image...
So far, I have this
} else if( isset($_FILES['image']) && $_FILES['image']['size']>0 ){
$directory="$abs_path";
$filename=substr(md5(microtime()),0,5)."_".$_FILES['image']['name'];
move_uploaded_file($_FILES['image']['tmp_name'],$directory.$filename);
chmod($directory.$filename,0644);
$query = "UPDATE $table SET imagefile='$filename' WHERE username='$username' LIMIT 1";
echo "<p align=\"center\"><b>Image updated. . .</b></p>
<p align=\"center\"><font color=green>Thank you, $username. Your image has successfully been uploaded!</font></br></center>";
}else{
problem('Only image files are allowed to be uploaded, please try again!');
}
$result1 = mysql_query ($query) or problem('Mysql threw an error: ' . mysql_error());
}
the echo reads when a picture IS uploaded, but when there's no image upload I get the problem function returned...
How do I write a statement which returns: no image uploaded, then updates the database with or without an image uploaded, but if a file's uploaded though it's not an image file uploaded e.g. zip, the problem function will be retuned.
I don't want to get into a pickle here and break my script, so I'm seeking HELP!