<?php
include "config.php";
//print_r($_POST);die;
if(isset($_POST['submit']))
 {
    $na=$_POST['Name'];
    $ca=$_POST['Cost'];
    $expiry=$_POST['Expiry'];
    $ccv=$_POST['Ccv'];
    $card=$_POST['Card'];
    
    // $conn=mysqli_connect("localhost","root","","petshop");
    // $conn=mysqli_connect("localhost","id18195887_petexchange","b!}Kdz@0KB^WiGpM","id18195887_petshop");
$sql="INSERT INTO payment(Name,Cost,Card,Expiry,Ccv) VALUES('$na','$ca','$card','$expiry','$ccv')";
    //print_r($sql);die;
    $result=mysqli_query($conn,$sql);
   // print_r($result);die;
    if($result==true){
        echo '<script> alert("Product Added");
        location.assign("index.php")
        </script>';
    } else{
        echo '<script> alert("Not Product Added");
        location.assign("Payment.php")
        </script>';
    }

}
