By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,060 Members | 1,878 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,060 IT Pros & Developers. It's quick & easy.

Shopping Cart Quantity

P: n/a
I'm developing a fairly basic shopping cart. My original implementation
had the user click on a link to add an item to the cart
(addtocart.php?item=123456). I figured it could just increase the
quantity every time the user clicked. However, with caching turned off
the quantity is increased if the user presses back and then forward in
his/her browser. Is there any simple way to avoid this? I noticed that a
lot of online retailers don't increase the quantity above 1 when a user
clicks on [Add to Cart]; they simply allow the user to enter a quantity
on the next page. Is this the best/only solution? Thank you!

--
- Michael J. Astrauskas

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Michael!

On Tue, 23 Sep 2003 20:55:11 -0700, "Michael J. Astrauskas"
<tr****@cox.net> wrote:
I'm developing a fairly basic shopping cart. My original implementation
had the user click on a link to add an item to the cart
(addtocart.php?item=123456). I figured it could just increase the
quantity every time the user clicked. However, with caching turned off
the quantity is increased if the user presses back and then forward in
his/her browser. Is there any simple way to avoid this? I noticed that a
lot of online retailers don't increase the quantity above 1 when a user
clicks on [Add to Cart]; they simply allow the user to enter a quantity
on the next page. Is this the best/only solution? Thank you!


Tthere was a posting about GET parameters that change the data in the
database some days before, which stated that you should not have any
of them. Instead use POSt and redirect to a GET request after you
changed the amount. That way
- back works
- reloading doesn't add again.

HTH, Jochen

--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.