I have a page that has a form on the first part that posts to itself and
dumps the contents of the form into a database.
All this is well and good - I'm using
if ($_POST['submit']) {
}
to detect the submission and everything is doing as it should.
Thing is if you refresh the page that
:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] preventing page from resubmitting when
refreshing page
I have a page that has a form on the first part that posts to
itself and
dumps the contents of the form into a database.
All this is well and good - I'm using
if ($_POST['submit
Is there something i can do on browser refresh to prevent this or prevent my
mysql database from duplicating the records?
Instead of using INSERT in your query use REPLACE INTO.
Alternately, after you are done processing the form, do this:
header( location: $PHP_SELF?$QUERY_STRING );
exit()