Stop page resubmit after message with F5
3 answers
StackOverflow is pretty heavy on AJAX, so you see the behavior you see.
If you don't want to receive all the AJAXy you need redirects. Redirects of this kind should be transparent to the user:
if (! empty($_POST)){
// Do something with the contents of $_POST
header('Location: success.php');
}
Now, if your validation fails, you will probably reload the form with some error messages, and the F5 interception will re-submit the data. But if the operation is successful, the user will be redirected to the success page and they can hammer f5 all day without re-setting the data and potentially create repetitive actions.
+6
source to share