Forum Moderators: coopster
I've got a simple form to send a photo. But when I send it $_FILES appears empty.
I've write enctype="multipart/form-data" in the HTML so I don't understand what happend.
The HTML:
<form action="submit.php" method="post" name="registerForm" enctype="multipart/form-data"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>Photo (max-width:800px):</td>
<td class="main "><input type="file" name="photo"> <span class="inputRequirement">*</span></td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
</tr>
<tr>
<td class="main" style="padding-left: 7px"><input type="submit" value="Enviar" /></td>
<td> </td>
</tr>
</table>
</form>
The PHP:
print "<pre>";
print_r($_POST);
print_r($_FILES);
print "</pre>"; The Result:
Array
(
[photo] => prueba.jpg
)
Array
(
)
Anyyyway....I'm glad you have yours working. Thanks for the additional information. If I find out more on this topic, I'll be sure to let everyone know :)