Whenever a user clicks refresh in their browser the following happens:
That last web address that was accessed is accessed again.
Any information that was sent to the web server is sent again.
There are, however, a couple of ways around this to stop the information going into the database just because the user clicked on refresh.
Have 1 file that inserts the information into a database. If it completes successfully send a redirection header:
header("Location: redirect.html");
or
header("Location: http://www.full.Path/toFile.html");
. As long as you do this before any other input is sent out you can redirect the user to another page (so that when they click refresh they get that new page instead of the one that is inserting the information.
Then, on that new page you can get the information that has just been inserted (however you want to do this is up to you), or just inform the user that everything went as planned. I'll have an example up in a bit so that you guys can follow it.
Enter your message below
Sign in or Join us (it's free).