I got a POST form, and it does send the data to the same file, and if use hit the back button in his browser, he can easily just re-send the data, and it’ll be still read.
Is there any way to avoid such behaviour?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The link Levi sent will answer for you. But in case you want an alternative, here is how I do it…
User posts to a class, like yours. same file. In the beginning of the class I do post processing. For this example I will make it very simple…
Now you can refresh over and over and not submit the form twice.
Edited to show further example. Obviously your validation and error handling should be a bit more sophisticated than this, but this should get you in the right direction.