TG napsal(a):
But what if the data being inserted isn't unique? What if it's a voting
form that says Do you like pie? Yes/No? True, it could record the
response and the userid or IP address so that would be a unique pairing but
what if the vote was anonymous and you allowed multiple
T K napsal(a):
I've learned that this is possible to make and send a unique id in
hidden input, and check if the id is used before database query is
issued. (PHP Cookbook [O'reilly]).
Why? You should always ensure that only unique data are inserted into
database. This is not just about multiple
for allowing non-unique input into the
database, depending on the circumstances.
-TG
- Original Message -
From: OKi98 [EMAIL PROTECTED]
To: T K [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Date: Fri, 05 Oct 2007 10:34:50 +0200
Subject: Re: [PHP-DB] Prevention for multiple submissions from
The most common method I've seen is with Javascript. onsubmit, disable
submit button.
As a backup, in case the user's JS is disabled, you might consider the unique
ID thing.
-TG
- Original Message -
From: T K [EMAIL PROTECTED]
To: php-db@lists.php.net
Date: Thu, 4 Oct 2007 20:09:01
).
Jon
-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 04, 2007 9:06 AM
To: T K; php-db@lists.php.net
Subject: RE: [PHP-DB] Prevention for multiple submissions from the same form
after submit direct the user to a different page...or use js
after submit direct the user to a different page...or use js and disable the
button after the first click
bastien Date: Thu, 4 Oct 2007 20:09:01 +0900 From: [EMAIL PROTECTED] To:
php-db@lists.php.net Subject: [PHP-DB] Prevention for multiple submissions
from the same form Hi, I have a form
Hi TK,
Try this,
input type=Submit name=butSubmit value=Submit ?php
if($_POST['butSubmit']=='Submit') {? disabled=disabled ?php }?
Regards,
Lasitha
-Original Message-
From: T K [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 04, 2007 3:09 PM
To: php-db@lists.php.net
Subject:
Thank you for answering my question. Can anybody explain a simple
JavaScript only solution? I haven't used JavaScript except for some
copy-and-paste jobs.
Tek
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
try
input type='submit' name='submit' value='Submit'
onclick='this.style.disabled=true;' /
bastien
Date: Fri, 5 Oct 2007 00:14:44 +0900 From: [EMAIL PROTECTED] To:
php-db@lists.php.net Subject: Re: [PHP-DB] Prevention for multiple
submissions from the same form Thank you for answering