is there a way to clear the form data in php?
i would want to know if is it possible to clear the form data through php.
i want to restrict the user from resubmitting the form even开发者_运维百科 if the user click back button in the browser.
thank you..
You want a "nonce", a unique value that is generated when the form is requested, then checked and invalidated when the form is submitted so that it can not be resubmitted.
There is already a question which discusses the FullThrottle nonce library for PHP, and another question about preventing the double-insert that typically happens when forms are submitted twice.
You should also be submitting the form via POST, and then redirecting the browser so that it requests the results via GET.
There is no way to clear the form using PHP if the user uses the back button, though meagar's answer may provide your solution.
精彩评论