I've been forced to be a real coder and write stuff with globals off for the first time, and I'm having problems with a form that has an option to upload an image. On the form I have a field like so:
<input type="file" name="userpic">
Then, in the script that processes the form's various info (all of which works except the blasted image), I have this:
if ($_FILES['userpic']) {
echo "ya a pic!";
exit;
}
Just to test whether a pic is passed or not. Unfortunately, it prints "ya a pic" everytime I hit submit, regardless of whether I've actually uploaded a pic or not. So I guess I'm missing something. Any ideas?