What are best practices to check to see if a .php script is called for the
first time versus a user hitting a refresh button on their browser?
I am playing around with a PHP front-end to a database. If the user enters
values in a form (form.html), hits submit, the PHP script (insert.php) puts
the submitted fields into the database as intended. insert.php displays a
success message if successful or an error message otherwise. If the user
hits the brower refresh button while at insert.php, the data is re-entered,
and I end up with a duplicate entry in the database.
This is the default behavior of Opera. IE prompts if I want to resend the
data vs. not doing anything. If the data is resent, then the duplicate
entry happens. I need to guard against this either way.
Thanks for your help.