I am trying to upload multiple images at once here is what i've got so far:
if(isset($_POST['submit'])) { $file_name=$_FILES["image"]["name"]; foreach($file_name as $files) { $target_path = "Sub_uploads/".$files; if(move_uploaded_file($files["image"]["tmp_name"],$target_path)) { $target_path="Sub_uploads/".$files; $sql = "INSERT INTO product_images (image) VALUES ('$target_path')"; $query = mysql_query($sql); } } echo "<script>alert('data inserted');document.location='Sub_CateGory_image.php'</script>"; } ?> It seems so that the error occurs at this line: if(move_uploaded_file($files["image"]["tmp_name"],$target_path))