我真的不明白爲什麼我得到這個錯誤或如何解決它! 變量傳遞給每個()不是上啉傳遞給每個()的變量不是數組或對象
while(list($key,$value) = each($_FILES['images']['name']))
完整代碼 -
$max_no_img=4; // Maximum number of images value to be set here
$imgs_names = array('CV', 'Research Plan', 'Degree Transcript', 'GRE Scores');
echo "<form method=post action='' enctype='multipart/form-data'>";
echo "<table border='0' width='400' cellspacing='0' cellpadding='0' align=left>";
for($i=1; $i<=$max_no_img; $i++){
echo "<tr><td>".$imgs_names[$i-1]."</br</td><td>
<input type=file name='images[]' class='bginput'></td></tr>";
}
echo "<tr><td colspan=2 align=center><input type=submit value='Submit'></td></tr>";
echo "</form> </table>";
while(list($key,$value) = each($_FILES['images']['name']))
{
echo $key;
echo "<br>";
echo $value;
echo "<br>";
if(!empty($value)){ // this will check if any blank field is entered
$filename =rand(1,100000).$value; // filename stores the value
$filename=str_replace(" ","_",$filename);
$add = "upload/$filename"; // upload directory path is set
copy($_FILES['images']['tmp_name'][$key], $add);
echo $add;
任何想法數組或對象?
嘗試'的var_dump($ _ FILES);'並且把輸出你的問題 – 2012-03-29 09:46:00
沒有什麼outputed – user1257518 2012-03-29 09:54:53