CGI form repost from browser--how to prevent?

Chris bit_bucket5 at hotmail.com
Tue Dec 11 13:51:53 EST 2001


I'm writing a Python cgi script that does some inserts into a mysql
database based on data in an html form submitted by a user.  Is there
any way to prevent the browser from reposting the data from the form
when the user hits refresh in the browser after they have submitted
the form?  When this happens, the script receives the same cgi form
data and performs the same inserts on the database.  I think maybe
this can be prevented by storing some state info with cookies??  Not
sure (have never used cookies).  Any ideas on an easy way to prevent
this?

Many Thanks.

-Chris



More information about the Python-list mailing list