Skip to main content
3 of 3
replaced http://stackoverflow.com/ with https://stackoverflow.com/
user avatar
user avatar

The easy way:

After saving to database, reload your page:

header('Location: comment-form.php'); 

This will make the browser "forget" the form submit.

The correct way:

Generate a nonce and add it as hidden input in your form. When the form submits, make sure $_POST['nonce'] matches with $nonce in your script.

How to create and use nonces

flowfree
  • 16.5k
  • 12
  • 55
  • 79