preventing page from resubmitting when refreshing page
| From: | mike karthauser | Date: | Thu, 09 Jan 2003 17:23:34 +0000 |
| Subject: | preventing page from resubmitting when refreshing page | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24705@lists.php.net to get a copy of this message | ||
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 displays the results it then posts to
the database again. I've tried some error trapping but in the same way the
page hold the post variables it just redoes what it has done rather than re
running the script.
Is there something i can do on browser refresh to prevent this or prevent my
mysql database from duplicating the records?
any help would be appreciated.
cheers
mikek
--
Mike Karthauser
Managing Director - Brightstorm Ltd
Email >> mikek@brightstorm.co.uk
Web >> http://www.brightstorm.co.uk
Tel >> 0117 9426653 (office)
07939 252144 (mobile)
Snailmail >> Unit 8, 14 King Square,
Bristol BS2 8JJ