Re: Double click problem
| From: | Eric Butera | Date: | Wed, 19 Mar 2008 16:01:07 +0000 |
| Subject: | Re: Double click problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271805@lists.php.net to get a copy of this message | ||
On Wed, Mar 19, 2008 at 11:48 AM, tedd <tedd@sperling.com> wrote:
> Hi gang:
>
> I have a situation where users can purchase stuff online.
>
> In the last step in the process, the user clicks a "confirm purchase"
> button and their credit card is checked and if it's valid, they are
> awarded the product. Everything works, but it takes a little time to
> check the credit card.
>
> During the time it takes to send the credit card information to the
> clearing house and get back an "Ok" with a transaction ID, the user
> can click the "confirm purchase" button more than once. As such, more
> than one order can be made during the process.
>
> I was thinking of using the database to prohibit multiple "confirm
> purchase" clicks made by the user, but I wanted to ask this group if
> anyone has a simpler idea/solution?
>
> Thanks,
>
> tedd
>
> --
> -------
> http://sperling.com
> http://ancientstones.com
> http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Unique form tokens.
Generate a token when the form is displayed and save that value in the session.
Then on post check it and remove it. Then if they re-submit it will
not exist therefore be invalid.