RE: Double Submission into DB if Hit Refresh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Add a hidden field into the form with a unique transaction ID.

When the data is submitted first time save the transaction ID to a table.

Before you do anything check to see if the transaction ID exists in the
table, if not then you are ok to save the transaction ID and then add/update
the data.

If the ID is already there, then do not add/update and send the user a
message to say they have submitted the same transaction twice.

HTH

Peter



> -----Original Message-----
> From: Craig Hoffman [mailto:choffman@xxxxxxxxxxx]
> Sent: 18 April 2004 01:30
> To: php-db@xxxxxxxxxxxxx
> Subject:  Double Submission into DB if Hit Refresh
>
>
> What is the best way to avoid data being resubmitted (entered twice) to
> DB (mysql) if the user hits refresh after POSTING data via a form?
> __________________________________
> Craig Hoffman - eClimb Media
>
> v: (847) 644 - 8914
> f: (847) 866 - 1946
> e: choffman@xxxxxxxxxx
> w: www.eclimb.net
> _________________________________
>
> --
> 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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux