Handling cgi
Andrew Moore
amoore at mooresystems.com
Wed Feb 25 20:14:27 CST 2004
On Wed, Feb 25, 2004 at 01:41:17PM -0600, Michael A. Morgan wrote:
> Howdie Gang,
>
> I'm having difficulty with perl scripts. Instead of
> displaying them the browsers, unexpectedly, try to download my
> scripts. Why? Server version: Apache/2.0.40, Syntax OK, (core.c,
> prefork.c, http_core.c, mod_so.c). AddHandler cgi-script .plk,
> Options include ExecCGI, and mode 755.
>
> Michael
Hi Michael -
Make sure you're printing out a "Content-type:" header. In perl, that
can be somthing like:
print "Content-type: text/htmlnn";
or if you are using the CGI module (and you probably should be):
use CGI;
$q = new CGI;
print $q->header;
See the CGI module documentation "perldoc CGI" for more information on
that.
Hope it helps.
-Andy
More information about the Kclug
mailing list