Jump to content

Help with PHP Shopping Cart Tutorial - Jon Lebensold


WebDeveloperMike

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...