SESSION value increases when browser is reloaded
Posted: Tue May 31, 2005 9:43 pm
I have a major issue and don't really know how to get around it.
What I am trying to do is this:
A user selects a value from a drop down list and then enters a quantity in a text field and then press an add button. The result is then transferred into a textarea box in the format of
'item xxxx (2)' without the quotes.
At the same time this happens a DB search is done to find out how many points a certain item is worth and is then added to a session variable. Many items can be added to to the textarea and thusly increasing the value of the session variable.
Then I can submit the form that updates my DB with the items and quantities and the total number of points accumulated (session variable)
All the above stuff works great, however I recently found out that if I click the refresh button or hit F5 before i submit the form, the session variable increments by the value of the last points value.
This is obviously unwanted and I need to know how I can achieve this with PHP prefferably, but am willing to try some javascript.
What I am trying to do is this:
A user selects a value from a drop down list and then enters a quantity in a text field and then press an add button. The result is then transferred into a textarea box in the format of
'item xxxx (2)' without the quotes.
At the same time this happens a DB search is done to find out how many points a certain item is worth and is then added to a session variable. Many items can be added to to the textarea and thusly increasing the value of the session variable.
Then I can submit the form that updates my DB with the items and quantities and the total number of points accumulated (session variable)
All the above stuff works great, however I recently found out that if I click the refresh button or hit F5 before i submit the form, the session variable increments by the value of the last points value.
This is obviously unwanted and I need to know how I can achieve this with PHP prefferably, but am willing to try some javascript.