Guest_imported
New member
- Jan 1, 1970
- 0
OK, I've only been doing CGI for a few hours. To be safe I changed my sripts to match the ones on the forum's FAQs.
The error message "Premature end of script headers" keeps logging everytime I try & execute the following test.html script from the Apache (1.3.19) server. (Linux)
I can run the test.html script locally but it won't call the test.cgi locally. I think I know why. However I can run the test.cgi script on the server & it just tells me it doesn't like the email address.
Is this an Apache setting or something? Oh yea, the permissions for the programs are 755.
test.html =============================
<HTML>
<HEAD><TITLE>Most Basic CGI Input
Page</TITLE></HEAD>
<BODY>
<FORM ACTION="/cgi-bin/test.cgi" METHOD="POST">
<P>email, please:
<INPUT TYPE="TEXT" WIDTH="25"
NAME="Email_Address">
</P></FORM></BODY></HTML>
test.cgi =============================
#!/usr/bin/perl
use CGI;
# instantiate a new CGI object. Call it $q.
$q = new CGI;
print $q->header;
print $q->start_html;
# retreive the Email_Address parameter submitted in the HTML
$email = $q->param('Email_Address');
# check to see if it looks like an email.
unless ($email =~ /.*@.*\.\w+/) { &killme("Not a valid email address" }
print "<P>Email is $email</P>\n";
print $q->end_html;
sub killme {
print "<P>$_[0]</P>";
print $q->end_html;
die;
}
The error message "Premature end of script headers" keeps logging everytime I try & execute the following test.html script from the Apache (1.3.19) server. (Linux)
I can run the test.html script locally but it won't call the test.cgi locally. I think I know why. However I can run the test.cgi script on the server & it just tells me it doesn't like the email address.
Is this an Apache setting or something? Oh yea, the permissions for the programs are 755.
test.html =============================
<HTML>
<HEAD><TITLE>Most Basic CGI Input
Page</TITLE></HEAD>
<BODY>
<FORM ACTION="/cgi-bin/test.cgi" METHOD="POST">
<P>email, please:
<INPUT TYPE="TEXT" WIDTH="25"
NAME="Email_Address">
</P></FORM></BODY></HTML>
test.cgi =============================
#!/usr/bin/perl
use CGI;
# instantiate a new CGI object. Call it $q.
$q = new CGI;
print $q->header;
print $q->start_html;
# retreive the Email_Address parameter submitted in the HTML
$email = $q->param('Email_Address');
# check to see if it looks like an email.
unless ($email =~ /.*@.*\.\w+/) { &killme("Not a valid email address" }
print "<P>Email is $email</P>\n";
print $q->end_html;
sub killme {
print "<P>$_[0]</P>";
print $q->end_html;
die;
}