P粉8173547832023-08-30 09:58:46
I also want to point out that you can use the JavaScript method window.history.replaceState
to prevent resubmits on refresh and back buttons.
sssccc
Proof of concept: https://dtbaker.net/files/ Prevent-post-resubmit.php(Link is no longer valid)
I still recommend the Post/Redirect/Get method, but this is a novel JS solution.
P粉0434322102023-08-30 09:17:22
Use publish/redirect/get pattern. http://en.wikipedia.org/wiki/Post/Redirect/Get
On my website I will store the message in a cookie or session, redirect after posting, read the cookie/session, and then clear the value of that session or cookie variable.