文件上传的 HTML:
<form enctype="multipart/form-data" action="" method="POST">
<br/>Upload Featured Image: <input name="imagefiles" type="file" /><br/>
<br/>Upload Gallery Image 1: <input name="imagefiles" type="file" /><br/>
<br/>
<input type="submit" name="submit" value="Add Product" />
</form>
为了处理上传,我这样做:
$imagefiles = $_FILES['imagefiles'];
foreach ($imagefiles['name'] as $key => $value) ----> [Line 25 in file]
{
}
但是,我收到了这个错误:
Warning: Invalid argument supplied for foreach() in /var/www/html/addProductForm.php on line 25 (Edit)