Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-08 Thread OKi98

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 people from the 
same IP address (ie behind a firewall/proxy) to submit votes?
  
simple solution with timestamp - you allow to vote from 1 ip once in a 
given time (day, hour, minute, second, depends on you)

There could be cases where the data isn't necessarily unique

Sorry, I dont know any.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-05 Thread OKi98

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 submissions. Visitor can 
submit form then forgets about that so he goes back and submits the same 
thing again.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-05 Thread TG

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 people from the 
same IP address (ie behind a firewall/proxy) to submit votes?

There could be cases where the data isn't necessarily unique, is all I'm 
saying.  In which case you could use the unique ID thing to make sure it's 
not a double-submit from the same person, or only allow a submission every 
XX seconds from a single IP address, or maybe create some kind of 
fingerprint of the voter using their browser type and version or some other 
odd method.  The unique ID thing is by far the simplest and less 
discriminatory against people beind firewalls or proxies.

So you see, there is some kind of case 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 same form

 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 submissions. Visitor can 
 submit form then forgets about that so he goes back and submits the same 
 thing again.
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread T K
Hi,

I have a form with a button, which adds user inputted data into
database. I've been looking for a way to prevent users from pressing
the same button twice mistakingly.

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]).

But, is there a way to make this happen without using database? It
would cool if I could only use HTML/JavaScript/CSS.

Tek.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread TG

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 +0900
Subject: [PHP-DB] Prevention for multiple submissions from the same form

 Hi,
 
 I have a form with a button, which adds user inputted data into
 database. I've been looking for a way to prevent users from pressing
 the same button twice mistakingly.
 
 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]).
 
 But, is there a way to make this happen without using database? It
 would cool if I could only use HTML/JavaScript/CSS.
 
 Tek.
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread Jonathan Gravois
I used the JavaScript method to disable the button after the first click and
discovered from irate customers and administration that this resulted in an
unsubmittable form on the AOL Browser although it worked perfectly in all
others. Just a mention in case your clientele is AOL heavy (like ours).

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 and disable the
button after the first click
 
bastien Date: Thu, 4 Oct 2007 20:09:01 +0900 From: [EMAIL PROTECTED] 
bastien To: php-db@lists.php.net Subject: [PHP-DB] Prevention for 
bastien multiple submissions from the same form  Hi,  I have a form 
bastien with a button, which adds user inputted data into database. 
bastien I've been looking for a way to prevent users from pressing the 
bastien same button twice mistakingly.  I've learned that this is 
bastien possible to make and send a unique id in hidden input, and 
bastien check if the id is used before database query is issued. (PHP 
bastien Cookbook [O'reilly]).  But, is there a way to make this 
bastien happen without using database? It would cool if I could only 
bastien use HTML/JavaScript/CSS.  Tek.  --  PHP Database Mailing 
bastien List (http://www.php.net/) To unsubscribe, visit: 
bastien http://www.php.net/unsub.php
_
Express yourself with new emoticons. It's easy! Try it!
http://www.freemessengeremoticons.ca/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread Bastien Koert

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 with a button, which adds user 
inputted data into database. I've been looking for a way to prevent users from 
pressing the same button twice mistakingly.  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]).  But, is 
there a way to make this happen without using database? It would cool if I 
could only use HTML/JavaScript/CSS.  Tek.  --  PHP Database Mailing List 
(http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php 
_
Express yourself with new emoticons. It’s easy! Try it!
http://www.freemessengeremoticons.ca/

Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread Lasitha Alawatta
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: [PHP-DB] Prevention for multiple submissions from the same form

Hi,

I have a form with a button, which adds user inputted data into
database. I've been looking for a way to prevent users from pressing
the same button twice mistakingly.

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]).

But, is there a way to make this happen without using database? It
would cool if I could only use HTML/JavaScript/CSS.

Tek.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for the 
addressee only. If you are not the named addressee you must not disclose, copy 
or take
any action in reliance of this transmission and you should notify us as soon as 
possible. If you have received it in error, please contact the message sender 
immediately.
This e-mail and any attachments are believed to be free from viruses but it is 
your responsibility to carry out all necessary virus checks and DOTW accepts no 
liability
in connection therewith. 

This e-mail and all other electronic (including voice) communications from the 
sender's company are for informational purposes only.  No such communication is 
intended
by the sender to constitute either an electronic record or an electronic 
signature or to constitute any agreement by the sender to conduct a transaction 
by electronic means.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread T K
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



RE: [PHP-DB] Prevention for multiple submissions from the same form

2007-10-04 Thread Bastien Koert

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 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 
_
Get cool Messenger Emoticons! Click here to learn more.
http://www.freemessengeremoticons.ca/