Re: CGI Error
On Sun, 7 Dec 1997, Hamish Moffatt wrote:
> You probably forgot to output the content type & the following blank line.
> Something like
>
> print "Content-type: text/html\n\n"
>
> would usually do it.
I didn't write this script and don't know perl, so I don;t know what is
wrong...
---
#!/usr/bin/perl
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY BGCOLOR=#FFFFFF>\n";
print "<CENTER>\n";
print "THANK YOU<BR>\n";
print "$fields{fname} $fields{lname}</BR>";
print "I will write<BR>\n";
print "you at<BR>\n";
print "$fields{email}<BR>\n";
print "</CENTER>\n";
print "</BODY></HTML>";
---
> However, you should at least read your web server error log before
> posting like this, it will usually tell you what went wrong. If you
> were missing the content type, Apache's error logs will tell you
> invalid script headers or similar. Then you should make sure you read
> the CGI specifications. None of this is a Debian or a Linux problem.
I was just looking at the cgi.log file, which didn't give any errors.. in
the error.log I get "[error] Premature end of script headers" messages..
what does this mean?
Thanks
Paul
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to:
- Follow-Ups:
- Re: CGI Error
- From: Martin Bialasinski <martin@internet-treff.uni-koeln.de>