<?php
include('../includes/connection.php');
$name=$_POST['name'];
$price1=$_POST['price1'];
$price2=$_POST['price2'];
$quantity=$_POST['quantity'];
$description=$_POST['description'];
$filename=$_FILES['image']['name'];
$tempname=$_FILES['image']['tmp_name'];
$folder = "images/" . $filename;
$sql="insert into product_add(name,image,price_1,price_2,quantity,description) values('$name','$folder','$price1','$price2','$quantity','$description')";
$result=mysqli_query($con,$sql);
if($result)
    
{
    move_uploaded_file($tempname,$folder);

    
    echo"<script>alert('successful');window.location.href='product.php'</script>";
}
else{
    echo"<script>alert('not successful');window.location.href='product.php'</script>";
}
?>