Re[2]: [PHP-WIN] Preventing multiple submits
| From: | Pablo Vera | Date: | Thu, 24 Aug 2000 17:03:03 +0000 |
| Subject: | Re[2]: [PHP-WIN] Preventing multiple submits | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2109@lists.php.net to get a copy of this message | ||
ZG> At 05:16 PM 8/24/00 +0100, James Duncan wrote:
>>Hi folks,
>>
>>I'm still working on my first PHP project and was wondering how to prevent
>>users from submitting the same form multiple times when they continually
>>click on the submit button. I've heard it's possible to prevent this with
>>Javascript but is it also possible to use PHP (encase the user doesn't have
>>Javascript enabled, etc)? I assume you could assign a temporary variable and
>>increment it when the submit button is pressed and then check against that?
>>Would that work? I'm sure people have already solved this problem?
ZG> Doing what you have proposed will work.
ZG> - zak
James, Zak:
I'm not so sure this is a good idea, I think that the problem should
be resolved, where the problem is originated, and eventhough I prefer
PHP, I think that in this case it should be solved by the Client-Side,
i.e. JavaScript. What I don't like of the Server-Side solution is
that the form WILL BE submitted a second time, and that (I'm not so sure)
the first submission will somehow be interrupted by the second one.
I'm really new to JavaScript, so my help stops here, but check this
address: http://www.pageresource.com/jscript,
they have some very
good JavaScript tutorials.
Saludos,
Pablo Vera