Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl (http://www.velocityreviews.com/forums/f17-perl.html)
-   -   passing perl variable to output html file (http://www.velocityreviews.com/forums/t25535-passing-perl-variable-to-output-html-file.html)

andy.t.chou@gmail.com 03-26-2005 08:11 AM

passing perl variable to output html file
 
I need to be able to have a hidden field (signiture) with each output
html file generated.

# (Get the first and last name from the html form)
$first_name = $q->param('FirstN');
$last_name = $q->param('LastN');

# attempting to pass the variable information to an output html file
to be used as hidden info needed to use later.

print HISTORY ('<INPUT TYPE="hidden" name="TestFirstN"
value="$first_name"\>');

print HISTORY ('<INPUT TYPE="hidden" name="TestLastN"
value="$last_name"\>');



When my second cgi script calls on the output html file from above..

my $fir = $q->param('TestFirstN');
my $la = $q->param('TestLastN');
print "$fir";
print "$la";


the debug print statements print out $first_name and $last_name instead
of the values that they are suppose to have. Can someone please help
me with this or provide another solution to basically be able to pass
variable from perl/cgi script to output html file. Thanks.


Joe Smith 03-27-2005 01:24 AM

Re: passing perl variable to output html file
 
andy.t.chou@gmail.com wrote:
> the debug print statements print out $first_name and $last_name instead
> of the values that they are suppose to have.


You have made as mistake in understanding perl's quoted strings.

$first_name = 'Joe';
$last_name = 'Smith';
print 'Using single quotes: $first_name $last_name\n';
print "Using double quotes: $first_name $last_name\n";


All times are GMT. The time now is 11:06 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.