Top Document: FAQ: Frequently Asked Questions about CGI Programming Previous Document: 3.18 How can I use Caches to make CGI scripts faster and more Net-friendly? Next Document: 3.20 How can I stop my CGI script reading and writing files as "nobody"? See reader questions & answers on this topic! - Help others by sharing your knowledge You can't. You just have to deal with it when they do. You can avoid re-processing a submission by embedding a unique ID in your Form each time it is displayed. When you process the form, you enter the ID in a database. Or, if it's already there, you don't repeat the processing. You probably want to expire your database entries after a little time: an hour should be fine in a typical situation. If you're already using cookies (e.g. a shoppingcart), an alternative is to use the cookie as a unique identifier. This means you also have to handle the situation where a user deliberately "goes round twice" and submits the same form with different contents. If your script may take some time to process, you should also consider running it as a background job, and returning an immediate acknowledgement to the user (see above if your "immediate" response gets delayed until processing is complete in any case). User Contributions:Top Document: FAQ: Frequently Asked Questions about CGI Programming Previous Document: 3.18 How can I use Caches to make CGI scripts faster and more Net-friendly? Next Document: 3.20 How can I stop my CGI script reading and writing files as "nobody"? Single Page [ Usenet FAQs | Web FAQs | Documents | RFC Index ] Send corrections/additions to the FAQ Maintainer: Nick Kew <nick@webthing.com>
Last Update March 27 2014 @ 02:12 PM
|
Comment about this article, ask questions, or add new information about this topic: