freelanceprogrammers.org Forum Index » Perl
Re: Passing variable between scripts
Joined: 27 Jun 2004
Posts: 3
Re: Passing variable between scripts
Try this for that print "" line.
print "<input type=hidden name="requiredname"
value="$in{`requiredname`}">
";
You don`t need to make the name="" part a variable. That is what the field name
is.
Julie A. Bolduc jbolduc@...
JPF Crochet Club
Free Patterns And More!
http://www.jpfun.com
----- Original Message -----
From: "Daniel S. Dawdy" <elist@...>
To: <perl_official@yahoogroups.com>
Sent: Monday, September 12, 2005 11:36 PM
Subject: [Perl] Passing variable between scripts
>I have a real stupid question. I have done this way back and can not
> for the life of me get it.
>
> I have a feedback form. The input code looks like: <input
> name="requiredname" size="30" type="text">
>
> That goes to a cgi script and is displayed on the screen: print "
> $in{`requiredname`}
";
> and the name appears. Now I want to be able to then have a final
> submit, or confirm if you will, which will then Email the information.
>
> So I added a: print " <FORM METHOD=POST
> ACTION=http://www.ribbonrail.com/cgi/WORKING-trade_secrets_input_mail.cgi>
";
> To the top of the code. and the [proper submit and /form> at the bottom.
>
> Now I am loosing the contents of $in{`requiredname`} in this second
> pass. I have tried adding
>
> print "<input type=hidden name=$in{`requiredname`}
> value="$in{`requiredname`}">
";
>
> to recreate the variable and pass it on to the next script.
> I have tried different combinations of this hidden tag to carry the
> contents of $in{`requiredname`} to the next script but it`s lost.
>
> I know this is simple but am stumped.
>
> Dan
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
Joined: 03 Jul 2005
Posts: 15
Re: Passing variable between scripts
Julie A. Bolduc <> wrote:
: Try this for that print "" line.
: print "<input type=hidden name="requiredname"
: value="$in{`requiredname`}">
";
: You don`t need to make the name="" part a variable. That is what the
: field name is.
Why are you avoiding the qq() operator?
print qq(<input type="hidden" name="requiredname"
value="$in{requiredname}">
);
$in{`requiredname`} indicates the OP is probably using
something other than CGI.pm to process cgi requests. %in is
usually accompanied by a call to an outdated CGI request
subroutine. Whenever you see %in ask the OP how they are
processing their forms or use CGI.pm subs in your answer.
use CGI;
my $q = CGI->new();
$q->hidden(
-name => `requiredname`,
-value => $q->param(`requiredname`),
);
That prompts the OP to ask about CGI.pm, the safest means to
processing CGI requests. It is important that we answer the
unwritten questions as well as the obvious ones.
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







