CGI Problem
by BenLRead(at)aol.com
|
Date: |
Tue, 6 Feb 2001 19:53:33 EST |
To: |
hwg-servers(at)hwg.org |
|
todo: View
Thread,
Original
|
|
Hi List,
Thankyou to everyone who helped with my last query, getting my test.pl
program to work. I got it working in the end by altering the config of my
web server to run cgi programs. However now I'm taking it a stage further
and I'm getting an input from a form and passing it into the following CGI
program.
#!c:\perl\bin\perl
use CGI;
$query = new CGI;
if ($query->param('age') >= 18) {
$voter = 'yes';
}
else {
$voter = 'no';
}
print $query->header;
print "<HTML><HEAD><TITLE>Are you old enough to vote?</TITLE></HEAD><BODY>\n";
print "<H1>Are you old enough to vote?</H1>\n";
if ($voter eq 'yes') {
print "<P>You are old enough to vote.</P>\n";
}
else {
print "<P>You are not yet old enough to vote.</P>\n";
}
print "</BODY></HTML>\n";
I get a server error come up once I press the submit button on the form which
links into the above program. Also when I try running it from the command
line using the perl -cw vote.pl it says unrecognized character \xD0 at
vote.pl line 1. Can someone please help?
Thanks.
Ben.
HWG: hwg-servers mailing list archives,
maintained by Webmasters @ IWA