Here is the form in HTML
<form method="post" action="reg.php" enctype="multipart/form-data">
<table width="100%" class="table4" cellpadding="0" cellspacing="0">
<tr>
<td align="right">Picture:</td>
<td><input type="file" id="pic1" name="pic1" /></td>
</tr>
</table>
<input type="submit" id="btnsubmit" name="btnsubmit" value="send" /></td>
</form>
In reg.php
print "<pre>";
print_r($_FILES);
print "</pre>";
$pic1 = $_FILES['pic1']['name'];
$pic1_type = $_FILES['pic1']['type'];
$pic1_size = $_FILES['pic1']['size'];
But the _FILES array is alwats empty:
Array
(
)
Notice: Undefined index: pic1 in reg.php on line 31
Please help!
My file is a 20kb png file and from phpinfo():
file_uploads On On
max_file_uploads 20 20
post_max_size 10M 10M
upload_max_filesize 10M 10M
The only case that I could think of where the keys are not being found are:
file_uploadsis disabled.Most probably the uploaded images exceed the maximum size defined in the server’s configuration. You can invoke phpinfo() to check your current limits.
If you want to change them, just modify the following properties on php.ini as needed:
Or use php_value within .htaccess: