On Mon, 1 Apr 2002, Aman Raheja wrote:
> If I do not use CGI.pm, is there no way to get away with netscape.
> Some of my other scrpts work just fine in Netscape without having used
> CGI.pm
> Any Suggestions?
The first output from any CGI script has to be a set of HTTP headers,
minimally including the content type of the returned document (there are
others but normally you can let the web server handle the rest for you).
To do so, the first output, expressed as a Perl print statment, would be:
print "Content-type: text/html\n\n";
If you're using CGI.pm -- and again, it's an extremely good idea to let
CGI.pm do this kind of grunt work for you -- then you can do this with:
use CGI;
my $q = new CGI;
print $q->header();
If you forget to include this information, IE will try to forgive you by
treating the result as if you really meant for it to be there, but
Netscape is not so forgiving -- and rightfully so. It is possible to write
a CGI script that, for example, produces an image file, as
print "Content-type: image/jpeg\n\n";
But IE will potentially garble this into HTML if you forget the header,
while Netscape will, as with the more standard example, just do nothing.
--
Chris Devers [EMAIL PROTECTED]
Apache / mod_perl / http://homepage.mac.com/chdevers/resume/
"More war soon. You know how it is." -- mnftiu.cc
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]