Why won’t this print “success” when I submit the form? I’m pretty sure it should.
<?php
if (count($_POST) > 0) {
echo "success!!";
}
?>
<form method="post" enctype="multipart/form-data">
<input type="file" name="userfile" />
<input type="submit" value="upload" />
</form>
At a guess, the submit field has no name, so it won’t be included in
$_POST. Your file upload will be placed in$_FILES, see Handling file uploads.