You post no code, but here's a guess:
If using CGI, check only one header is being printed.
If printing header manually, check blank line appears after it, ie print "Content-Type: text/html\n\n"; - if you got this wrong, your server may be trying to guess the content type since you didn't supply one as it expected, and ends up printing an extra header.
cLive ;-)
Please try to think about code to show us when asking these questions, otherwise we just make stabs like this :) | [reply] |
If you're using CGI.pm, try using the :unique_headers option. This will prevent a CGI object printing more than one http header.
Example:
$ perl -e 'use CGI qw/ :unique_headers /; $q = CGI->new; print $q->header, $q->header'
Content-Type: text/html; charset=ISO-8859-1
$
If this fixes the problem, you should probably still have a look through your code and figure out where the redundant header is being printed.
| [reply] |
Seems indeed that you have more than one header printed out, otherwise you would get an error rather than "Content-Type: text/html" printed out.
It looks to me like you have this script called within another script, where there is already a header in there. You should check on that.
--cs
update: oakbox is right, as was ginseng: An empty line before any content is sent might be the cause. I didn't read ginseng's post properly there, sorry.
--cs | [reply] |
Actually, the blank line(s) before the
"Content-Type: text/html"
line is a possible cause here. Some non-standard HTML
browsers (>MSIE<) will assume HTML content and just
print out everything to the screen (including the misplaced
content-type statement).
Other
browsers,
like Netscape and Opera, display what they are supposed
to display. That is, they break like they are supposed to :)
Richard
| [reply] |
I think this would also happen if there is a blank line (rather, any content at all) going to the client before the header is sent.
| [reply] |