dave983
02-11-2007, 11:10 PM
I'm new to PERL-CGI and am trying to use an HTML form to print out a PERL script. However, the PERL code is printing to the screen.
The simplest of PERL scripts, name websurvey2.cgi:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, world";
HTML code:
<HEAD>
<TITLE>Example using FORMS</TITLE>
</HEAD>
<BODY BGCOLOR=white>
<FORM NAME=mysurvey ACTION="/usr/local/apache2/cgi-bin/websurvey2.cgi" METHOD="post">
Enter anything and click submit:<br>
<INPUT TYPE="text" size=40 NAME="favoriteurl" VALUE=""><BR><BR>
<CENTER>
<INPUT TYPE="submit" VALUE="SUBMIT">
</CENTER>
</FORM>
</BODY>
Output to the browser:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, world";
The simplest of PERL scripts, name websurvey2.cgi:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, world";
HTML code:
<HEAD>
<TITLE>Example using FORMS</TITLE>
</HEAD>
<BODY BGCOLOR=white>
<FORM NAME=mysurvey ACTION="/usr/local/apache2/cgi-bin/websurvey2.cgi" METHOD="post">
Enter anything and click submit:<br>
<INPUT TYPE="text" size=40 NAME="favoriteurl" VALUE=""><BR><BR>
<CENTER>
<INPUT TYPE="submit" VALUE="SUBMIT">
</CENTER>
</FORM>
</BODY>
Output to the browser:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, world";