I am trying to insert the below code snippet into the database but it is not entering and I don’t know what I did wrong.
Please, how can I output whatever I selected to the browser using var_dump or
<pre>
<?php if ($_POST) { print_r($_POST); } ?>
</pre>
here is the code snippet
<?php
if(isset($_GET['add_cart'])){
$ip_add = getRealUserIp();
$p_id = $_GET['add_cart'];
$product_qty = $_POST['product_qty'];
$size = $_POST['size'];
$query = "insert into cart (p_id,ip_add,qty,size) values ('$p_id','$ip_add','$product_qty','$size ')";
$run_query = mysqli_query($connection,$query);
echo "<script>window.open('single-product.php?id=$p_id','_self')</script>";
}
?>