Page 1 of 1

Stop the Refresh from updating my shopping cart

Posted: Mon Jul 21, 2003 1:30 pm
by jshields55
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

Posted: Mon Jul 21, 2003 4:29 pm
by AVATAr
post and get have the same problem.. if you reload...

so after the user add an item in the cart, the best solution is to move him to another page (Header), and with a link like: Click here to continue or something.