php - Unindentified index and use of unindentified constant -
this question has answer here:
notice: undefined index: qty in c:\xampp\htdocs\ecommerce\cart.php on line 130
notice: use of undefined constant qty - assumed 'qty' in c:\xampp\htdocs\ecommerce\cart.php on line 137
<?php if(isset($_post['update_cart'])){ //line 128 $qty =$_post['qty']; $update_qty ="update cart set qty='$qty'"; $run_qty =mysqli_query($con, $update_qty); $_session ['qty']=$qty; $total=$total*qty; //line 137 } ?>
you forgot $ before qty in line 137 , seems $_post['qty'] empty
$total=$total*qty;
suppost
$total=$total*$qty;
fixed version:
if(isset($_post['update_cart'])){ $qty =$_post['qty']; $update_qty ="update cart set qty='$qty'"; $run_qty =mysqli_query($con, $update_qty); $_session ['qty']=$qty; $total=$total*&qty; }
hope helps