Link to home
Start Free TrialLog in
Avatar of FairyBusiness
FairyBusinessFlag for United States of America

asked on

Why does my page need to be refreshed to show the shopping cart update?

Hi, I have a function that returns the correct update:

function updateCart() {
      if((isset($_POST['update'])) && (isset($_POST['qty'])) && (isset($_POST['item']))) {
            $item = trim(mysql_clean_strings($_POST['item']));
            $qty = trim(mysql_clean_strings($_POST['qty']));
            $cart = $_SESSION['cart'];
            $_SESSION['cart'][$item] = $qty;
            var_dump($qty);
            return $qty;
      }
}

but it doesn't show the update till the next time (either enter a new quantity or click refresh).  How can I make it show the changes on the first click (submit) ?

You will need to add something first:

http://auroriella.com/bracelet.php?item=b3
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FairyBusiness

ASKER

Thanks!