Jump to content

Recommended Posts

Posted

Hi everybody,

 

I was able to complete the php shopping cart tutorial by Jon Lebensold with no problems, however, I do notice that after you add an item to your shopping cart - if you refresh the browser - it adds the item again. and if you refresh a 2nd, 3rd, or 4th time it keeps adding items to your shopping cart. Is there any way to stop it from adding items to your shopping cart when the page is refreshed?

 

Here is a link to the finished shopping cart: http://www.mikespot.net/PaypalShoppingCart/html/index.php

 

Thank in advance for help. :)

 

Mike Bostone

Posted

I noticed that it only adds more items when the browser is refreshed right after an item is added to the cart because the browser's url text area says "...addToCart.php?id=TOMATOSOUP" so I believe its adding it because of that 'id=TOMATOSOUP' because when i click 'view cart' and the url is just "...addToCart.php" and I refresh the browser it does not add additional items to the cart.

 

Just thought id post a little more to make it easier for help. thanks guys!

 

Mike

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...