I have a form that has multiple text fields and one file field that reads:
<INPUT TYPE=file NAME=userfile>
Upon submitting, I want the script to check and see if any file was added and if so, do this, if not do that. I've tried the following:
if ($userfile) {
do this
} else {
do that
}
...but the script acts as if a file was uploaded, whether one was or not. If I change the if statement to a input text variable, it works fine so I have a feeling I'm not working this file input right. There must be a different trick to telling PHP that there is no file? Help please!