Every CGI script must output an HTTP header giving a MIME content type, such as Content-type: text/html, with a blank line after it:
print "Content-type: text/html\n\n"; |
Put this at the top of every CGI script, as the first thing that's printed.
If your output is of another MIME type, you should print out the appropriate Content-type: header - for instance, a CGI program which outputs a random GIF image would use Content-type: image/gif