Nihil Angst has asked for the wisdom of the Perl Monks concerning the following question:
Hi. I'm a newbie at Perl and I'm delighted
to find a Web site like this one.
I'm trying to use information gathered from
a form to generate personalized Web pages.
When I submit the form, rather than being taken
to the page-generating script, my browser displays
the code for the script that's supposed to process
the form data. When I try to access the page-
generating script from within File Manager,
I get an error message: "Your script produced
this error: (Maybe you didn't strip carriage
returns after a network transfer?)" . I've
looked at my uploaded code and I don't
see any added carriage returns.
Here's the code for the form and the page-
generating script. since my site is on Tripod, I
don't need #!/usr/local/bin/perl in the first
line. First, the form:
<FORM METHOD="get" ACTION="cgi-bin/TripodCGI.pm"> First Name: <INPUT TYPE="text" NAME="firstName" SIZE="25"><BR> Last Name:<INPUT TYPE="text" NAME="lastName" SIZE="25"><BR> Age: <INPUT TYPE="int" NAME="Age" SIZE="3"><BR> <INPUT TYPE="hidden" NAME="end_display" VALUE="cgi-bin/HTML.cgi"> <INPUT TYPE="submit"> <INPUT TYPE="reset"><BR> </FORM>
And here's the code for the page-generating script:
require TripodCGI.pm; $CGI = new TripodCGI.pm; $firstName = $CGI->param('firstName'); $lastName = $CGI->param('lastName'); $Age = $CGI->param('Age'); print "Content-type: text/html\n\n"; print <<ENDHTML; <HTML> <HEAD> <TITLE>CGI Test</TITLE> </HEAD> <BODY> <P>Greeings, $firstName, we're glad to see you. Members of the $lastName family are always welcome here. It's hard to believe that you're already $Age years old! How time flies.</P> </BODY></HTML> ENDHTML
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Form submit jumps to wrong file.
by chromatic (Archbishop) on Aug 06, 2002 at 23:13 UTC | |
by Nihil Angst (Novice) on Aug 07, 2002 at 01:51 UTC | |
by Popcorn Dave (Abbot) on Aug 07, 2002 at 04:25 UTC |