php - Unindentified index and use of unindentified constant -


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


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo