Stop the Refresh from updating my shopping cart
Posted: Mon Jul 21, 2003 1:30 pm
Hello,
I'm new to PHP and mysql, working on my first cart with sessions. Basically on each product page there is an "add to cart" button that has a variable attached, ie ..www.cart.php?new=43445, then on the cart page a php script runs a mysql query and spits out the cart with the product information.
The problem is when I press the browser's refresh or the forward or back buttons the quantity of the item in the cart goes up by one. Hopefully this is a simple problem with an easy solution. Does anyone know how to fix this?
Should I use the php post and get functions instead of the ?=product id at the end of the URL?
Jason
I'm new to PHP and mysql, working on my first cart with sessions. Basically on each product page there is an "add to cart" button that has a variable attached, ie ..www.cart.php?new=43445, then on the cart page a php script runs a mysql query and spits out the cart with the product information.
The problem is when I press the browser's refresh or the forward or back buttons the quantity of the item in the cart goes up by one. Hopefully this is a simple problem with an easy solution. Does anyone know how to fix this?
Should I use the php post and get functions instead of the ?=product id at the end of the URL?
Jason