Preventing browser refresh from reposting form values -- cac
Posted: Fri Apr 21, 2006 4:15 pm
I'm wondering how to prevent a page refresh from re-posting the form values so that PHP won't re-process the same form submission twice.
For example, I'm building my own custom message board and when a poster submits their new post, they get the result page which shows that their message was successfully posted. But if they refresh the browser window, they'll end up posting the message again.
Is this where session.cache_limiter comes in?
I realize I could send another header once the post has been logged into the DB in order to forward on to yet another page (preventing this refresh scenario) but I'd prefer a slightly easier method of preventing the refresh from happening altogether.
For example, I'm building my own custom message board and when a poster submits their new post, they get the result page which shows that their message was successfully posted. But if they refresh the browser window, they'll end up posting the message again.
Is this where session.cache_limiter comes in?
I realize I could send another header once the post has been logged into the DB in order to forward on to yet another page (preventing this refresh scenario) but I'd prefer a slightly easier method of preventing the refresh from happening altogether.