Re[2]: [Xitami] Re: ActivePerl & Xitami - CGI problems Continued
Peter van der Goes
xitami@lists.xitami.org
Wed, 25 Sep 2002 08:29:07 -0500
Wow! A dim light is glowing at the end of the tunnel!
I, too, don't know if attachments are "allowed" here, but I'm very glad you
sent it.
This should take us further down the road to seeing what is wrong in my
situation.
I tool your script, commented out all the mail stuff and tried this:
<animal.html>
<html>
<head>
<title>Animal</title>
</head>
<body>
<form action="http://localhost/cgi-bin/animal.pl" METHOD=POST>
Which animal? <INPUT type="text" name="animal">
<P><INPUT type="submit">
</form>
</body>
</html>
<animal.pl>
#!C:\Perl\bin\perl.exe -w
#
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
print "<HTML>\n";
print "<head><title>The Animal!</title></head>\n";
print "<BODY>\n";
my $animal = param('animal');
print "hello? <br>\n";
print "Thank you for identifying your favorite animal!<p>\n";
print "Your animal is: $animal\n";
print "<BR>";
print "</BODY>\n";
print "</HTML>\n";
This works just fine! Hurrah!! I now have a workaround.
Compare to this version of
<animal.pl>
#!C:\perl\bin\perl.exe -w
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fayalsToBrowser);
my $animal:
$animal = param('animal');
print "Content-type:text/html\n\n";
print "Show me the $animal";
Which still returns the (by now) infamous blank page.
So, it seems to me (newbie, remember!) that the part that does not work is:
print "Content-type:text/html\n\n";
So, is my CGI not producing the needed HTML wrapper around print "Show me
the $animal"; ?
If the .pl script supplies the tags, all is well. Or, so it appears.
Again, thanks very much, Paul, and all the rest of you who have helped me
here. I really appreciate it!
(But, I still want to find out *why* print "Content-type:text/html\n\n";
doesn't work for me 8)).
----- Original Message -----
From: "Paul Reid" <preid@rci.rutgers.edu>
To: "Peter van der Goes" <xitami@lists.xitami.org>
Sent: Tuesday, September 24, 2002 10:52 AM
Subject: Re[2]: [Xitami] Re: ActivePerl & Xitami - CGI problems Continued
> No, it isn't the browser. I hate to exonerate IE, and it will
> sometimes throw bogus error messages, but it should work.
>
> PLEASE use the "Carp Fatals To Browser" code Patricko posted. IMHO,
> you can not debug these things without it.
>
> Are we allowing file attachments on this list? If so, attached is a
> Perl form-handler that works for me. It is called from a form that
> supplies the variables "$ENV{FORM_...." and sends an email via the
> local host, then prints something for the user to see (either
> "Thanks" or "error").
>
> I have clobbered the script name and the shebang so nobody's email
> reader tries to Run it. No matter, because I've also clobbered the
> mail parameters so you guys won't annoy the person who gets the real
> script's emails.
>
> If you fix the shebang, it should at least return a polite error
> message. if called from a form with "name" "gender' and "Address1"
> fields, it should display them before erroring on the mail-call. If
> even that does not work, un-comment the line with "Hello?" and see
> if it runs that far.
>
> -PRR