> ------------ Original Message -----------
> From: Mark Fowler <[EMAIL PROTECTED]>
> Date: Wed, 13 Jun 2001 13:58:30 +0100 (BST)
> 
> that like normal CGI you should take care that results are not
> submitted more than once should the user refresh/reload the page.

One suggestion on the resubmit problem. I've taken to having the page submit back to 
itself, which does the form processing. If the form has not been submitted yet (I use 
a hidden element to check for this), then just print the form. Otherwise, the code 
that does the real work is run. Then, and this is the important part, I redirect to a 
results page with a message about what happened. This is your standard HTTP redirect 
(Status 302 IIRC). 

The great thing about this is that if the user clicks "reload" then they just get the 
results page again, and no real work is done! Yes, it's an extra HTTP call, and a 
little more work on the browser. However it's worth it from my perspective because the 
programming logic to catch resubmitted pages is greatly reduced, with no surprises.



Reply via email to