Top Document: FAQ: Frequently Asked Questions about CGI Programming Previous Document: 4.2 I'm having trouble with my headers. What can I do? Next Document: 4.4 I tried to use (Content-Type|Location|whatever), but it appears in my Browser? See reader questions & answers on this topic! - Help others by sharing your knowledge Your script must follow the CGI interface, which requires it to print: (1) One or more Header lines. (2) A blank line (3) (optional, but strongly advised) a document body. This error means it didn't. The Header lines can include anything that's valid under HTTP, but must normally include at least one of the three special CGI headers: Content-Type Location Status Example (a very minimal HTML page via CGI) Content-Type: text/html <= Header <= Blank Line <title>HelloWorld</title>Hello World <= Document Body A common reason for a script to fail is that it crashed before printing the header and blank line (or while these are buffered). Or that it didn't run at all: you _did_ try it from the commandline as well as check the file permissions and server configuration, didn't you? Another possible reason is that it printed something else - like an error message - in the Headers. Check error logs, put a dummy header right at the top (for debugging only), check the "Idiot's Guide", and use the debug mode of your CGI library. User Contributions:Top Document: FAQ: Frequently Asked Questions about CGI Programming Previous Document: 4.2 I'm having trouble with my headers. What can I do? Next Document: 4.4 I tried to use (Content-Type|Location|whatever), but it appears in my Browser? 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: