-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