GET method issue
Posted: Tue Dec 01, 2009 5:06 am
Hi,
I'm new to PHP and in order to learn the language and the concepts I'm working on a e-commerce website with a shopping cart, etc.
In this site I have items, when an item is clicked, the id of the item is sent via the GET method to the shopping cart page. Using this id i add the item to the shopping cart(table) and it works fine.
The issue is; if the user clicks the refresh button, the item is added again to the shopping cart. Do you think that disabling the refresh button or F5 button is a good option? what must i do to prevent the user from adding the item to the shopping cart when the page is refreshed?
In forms I've noticed that "(isset($_POST['Submit'])){}" is helpful but for the GET method this doesn't work accordingly.
Your help is appreciated.
I'm new to PHP and in order to learn the language and the concepts I'm working on a e-commerce website with a shopping cart, etc.
In this site I have items, when an item is clicked, the id of the item is sent via the GET method to the shopping cart page. Using this id i add the item to the shopping cart(table) and it works fine.
The issue is; if the user clicks the refresh button, the item is added again to the shopping cart. Do you think that disabling the refresh button or F5 button is a good option? what must i do to prevent the user from adding the item to the shopping cart when the page is refreshed?
In forms I've noticed that "(isset($_POST['Submit'])){}" is helpful but for the GET method this doesn't work accordingly.
Your help is appreciated.