Top Document: FAQ: Frequently Asked Questions about CGI Programming Previous Document: 3.13 Can I redirect users to another page? Next Document: 3.15 Can I write output to a different Netscape frame? See reader questions & answers on this topic! - Help others by sharing your knowledge Yes, but think carefully first: How are your readers going to know that their "submit" has succeeded? They may hit 'submit' many times! The correct solution according to the HTTP specification is to return HTTP status code 204. As an NPH script, this would be: #!/bin/sh # do processing (or launch it as background job) echo "HTTP/1.0 204 No Change" echo (as non-NPH, you'd simply replace HTTP/1.0 with the Status: CGI header). Alan J Flavell has pointed out that this will fail with certain popular browsers, and suggests a workaround to accommodate them: [ May 1998 update[1]: I'm deleting Alan's suggestion, because the problem is mainly of historical interest, and the workaround is no longer recommended. See his page for a a detailed survey and recommendations. ] His survey is at http://ppewww.ph.gla.ac.uk/%7Eflavell/status204/results.html [1] With apologies to Alan for having left it in so long. User Contributions:Top Document: FAQ: Frequently Asked Questions about CGI Programming Previous Document: 3.13 Can I redirect users to another page? Next Document: 3.15 Can I write output to a different Netscape frame? 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: