cgi form submission
a.eyre at optichrome.com
Wed Mar 15 17:23:20 CET 2000
> I've got a cgi program that takes input and submits it to a database,
> when this happens, rather than send the user to some useless page
> like "info added" or something, I redirect to the page that would
> normally be used to view the info. The problem is that, if the user
> reloads the page for some reason, the info is entered into the database
> again. Is there an easy way to prevent this from happening?
How about this:
When you generate the input form page, add in a hidden field containing
an incrementing sequence number, and if you get the same number twice
in the cgi script, ignore the second one.
If that makes sense :)
More information about the Python-list