Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My code was working fine for one image upload.I tried to upload three images and save it in another folder.
I also changes php.ini file max_post_size=32M

I am not getting nay error but unable to move uploaded file in defined location.
html code:


please help,i am stuck in this issue for a long time.

What I have tried:

HTML
<pre lang="PHP">
Product Image1: Product Image2: Product Image3: </tr
php code:
<?php
if(isset($_POST['insert_post'])){

//getting product image
$product_image1 = $_FILES['product_image']['name'];
move_uploaded_file($_FILES['product_image'['tmp_name'],"product_images/$product_image1");

$product_image2 = $_FILES['product_image2']['name'];
move_uploaded_file($_FILES['product_image2'['tmp_name'],"product_images/$product_image2");

$product_image3 = $_FILES['product_image3']['name'];
move_uploaded_file($_FILES['product_image3']['tmp_name'],"product_images/$product_image3");

$insert_product = "insert into products (cat_id,product_color,product_title,product_price,product_desc,product_image,product_image2,product_image3,product_keywords,product_stock) values('$product_cat','$product_color','$product_title','$product_price','$product_desc','$product_image1','$product_image2','$product_image3','$product_keywords','$product_stock')";

$insert_pro = mysqli_query($con,$insert_product);
if($insert_pro){
echo "alert('Product Has Been Inserted!')";
echo "window.open('index.php?insert_product','_self')";
}``
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900