December 16th, 2013, 01:50 PM
Backing Up through a Form submission
I have an application written in PHP/MySQL.
How can I keep users from using the "back" function and accidentally re-submitting a form that they have just submitted?
(oops, I accidentally did just that... sorry for the duplicate post)
December 16th, 2013, 02:00 PM
In your form, you could use a "form token" (a random hash) which is sent over and then stored with the data, if that token's already been used then don't re-import the data, the browser will still whine if the user pressed back (nothing you about that) but at least your form data won't be logged twice.
"For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
- George Orwell, 1984
December 16th, 2013, 06:51 PM
Great! Thanks for the reply.
Originally Posted by badger_fruit
So, I assume therefore, that I need to add a new field to each of my data tables and then I need to modify every routine with a "submit" statement to add a "pre-submit" query to check for the existence of the same token.... Right?
December 16th, 2013, 06:59 PM
This is overkill as long as you just wanna prevent the browser from resubmitting the form. See your other thread.