RE: [PHP] Stopping Forms Being Submitted Twice or Not Complete[Scanned]
| From: | Michael Egan | Date: | Mon, 28 Apr 2003 11:52:29 +0000 |
| Subject: | RE: [PHP] Stopping Forms Being Submitted Twice or Not Complete[Scanned] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-145515@lists.php.net to get a copy of this message | ||
Vicky,
You can use JavaScript to check that fields are complete but I'm not sure whether this will
deal with the issue of duplicate entries.
I often set some kind of identifier on the first form and set it in a hidden field ( using
md5(uniqid(time())) ) to store in the table when the form is submitted. When subsequently saving the
data you can then check on whether a record has already been created with this identifier and only
save the record if this is not the case.
I don't know whether this is the most elegant or efficient solution. Any further thoughts
would be welcome!
HTH,
Michael Egan
-----Original Message-----
From: Vicky [mailto:vprince@btinternet.com]
Sent: 28 April 2003 11:39
To: php-general@lists.php.net
Subject: [PHP] Stopping Forms Being Submitted Twice or Not
Complete[Scanned]
Is there some php code I can put in to stop forms being submitted more than once, or half complete?
And if there is what is it and where should I put it? I'm getting fedup with duplicate and
blank entries filling my guestbook ;-)