这是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>
在 reg.php
print "<pre>";
print_r($_FILES);
print "</pre>";
$pic1 = $_FILES['pic1']['name'];
$pic1_type = $_FILES['pic1']['type'];
$pic1_size = $_FILES['pic1']['size'];
但是 _FILES 数组总是空的:
Array
(
)
Notice: Undefined index: pic1 in reg.php on line 31
请帮忙!
我的文件是一个 20kb png 文件,来自 phpinfo():
file_uploads On On
max_file_uploads 20 20
post_max_size 10M 10M
upload_max_filesize 10M 10M