Naturally. You have this line:
if (!isset($HTTP_POST_FILES['userfile'])) exit;
That will exit the script(and the html) after that line when theres no fileupload. BTW, using $HTTP_POST_FILES is deprecated for a long time althought they work now, but for example on server that has PHP5 you have to explicitly turn those long arrays on.
Use $FILES(and $POST,$_GET etc.) instead.