|
老師您好: 書籍php5與mysql範例,執行以下程式碼,得到Notice: Undefined index: fileUpload in C:\xampp\htdocs\upld\php_file10.php on line 2
<?php $i = count ( $_FILES ["fileUpload"] ["name"] ); for($j = 0; $j < $i; $j ++) { if ($_FILES ["fileUpload"] ["error"] [$j] == 0) { if (move_uploaded_file ( $_FILES ["fileUpload"] ["tmp_name"] [$j], "./" . $_FILES ["fileUpload"] ["name"] [$j] )) { echo $_FILES ["fileUpload"] ["name"] [$j] . "上傳成功!<br />"; } else { echo $_FILES ["fileUpload"] ["name"] [$j] . "上傳失敗!<br />"; } } } ?> |