<?php
session_start();
    if($_SERVER['REQUEST_METHOD']=="POST"){
        include("db.php");
        $name=$_POST['fname'];
        $amount=$_POST['$amount'];
        $price=$_POST['price'];
        $image=$_POST['image'];

        $sql="INSERT INTO `basket`(`User_id`,`Product_id`, `ProductName`, `Amount`, `Price`,'ProductImage') VALUES (?,?,?,?,?)";
        $stmt=mysqli_stmt_init($conn);
        mysqli_stmt_prepare($stmt,$sql);
        mysqli_stmt_bind_param($stmt,"iisdis",$_SESSION['id'],$id,$name,$amount,$price,$image);
        if(!mysqli_stmt_execute($stmt)){
            die("ERROR" .mysqli_stmt_error($stmt));
        }
        else{
            echo"<script>alert('Item successfull added to basket');</script>";
            echo"<script>window.location.href='Customer=Products.php';</script>";
        }
    }
?>