-1
請參閱多文件上傳給定腳本的未定義的錯誤偏移:4的行未定義,偏移:4的行
for($i=0; $i<=count($_FILES['pics']); $i++) {
$tmpFilePath = $_FILES['pics']['tmp_name'][$i]; // this row error
$extract=explode(".",$_FILES["pics"]["name"][$i]);
$exten=$extract[1];
$completes=str_shuffle(str_replace(" ","",$_POST["title"].$extract[0])).".".$exten;
$images[]=$completes;
$newFilePath = "data/product/" . $completes;
move_uploaded_file($tmpFilePath, $newFilePath);
$data = getimagesize($newFilePath);
$width=$data[0];
$height = $data[1];
$newWidth= $width/$height*342;
$image = new SimpleImage();
$image->load($newFilePath);
$image->resize($newWidth,342);
$image->save("data/product/".$completes);
}
$images=implode(",",$images);
使用'
Sirko
現在給它通知:未定義偏移:3在 –
我沒看過其餘的代碼。你的問題是,你誤解了'$ _FILES'數組的結構。使用例如'var_dump()'來查看它的結構。我想你會發現那個錯誤。 – Sirko