I am having a little trouble with the following code. Logically, what should happen is this:
a. user submits form
b. if Image Upload box is NOT empty, then submit with new image info
c. if Image Upload box IS empty, then use default.gif
Sounds simple, right? It all works great until I get to the ELSEIF statement. See below.
$f2 = "$userfile";
if("$f2" != "none"){ //if $userfile isn't empty, then copy new image to server and thumbnail it
stripslashes($userfile);
copy($userfile,$graphic);
//this creates a thumbnail and copies it to thumbnail directory
system("convert -quality 90 -sample '$new_wx$new_h' '$graphic' '$graphics'");
if (!is_uploaded_file ($userfile)){ //if not uploaded, spit back error
echo "<b>$userfile_name</b> couldn't be copied !!";
}
// check whether it has been uploaded
if (is_uploaded_file ($userfile)){ //if the image uploaded successfully, tell us that it was
echo "
<b>$userfile_name</b> copied succesfully !!";
}
elseif ("$f2" == "none"){
stripslashes($userfile);
$userfile = "default.gif";
}
}
So why oh why does 'default.gif' never get used into the UPDATE statement?