A better way would be to make a call to header("location: form.php");
after processing the form. This will redirect you back to the form page, and if you refresh it, the browser will not re-submit the form data.
Alternatively, you can check if you have already processed the received data, but it will still give you a warning that you are going to resend the data.
You can do both, just in case someone uses the "Back" button and accidentally clicks "Send" again.
source share