--- Kyle Babich <[EMAIL PROTECTED]> wrote:
> Now what would I use to get multiple variables working at once, like:
> test.cgi?body=a&nav=5&bg=abc
> Would it go like this:
>
> #!/usr/bin/perl -wT
> use strict;
> use CGI qw/:standard/;
>
> print "Content-type: text/html\n\n";
>
> my $date = localtime;
> my $body = param('body');
[snip]
> my $nav = param('nav');
You have the right idea:
my $body = param('body');
my $nav = param('nav');
my $bg = param('bg');
Incidentally, you might have multiple values for the same name (such as being able to
select
several checkboxes:
<input type="checkbox" name="sport" value="basketball"> Basketball
<input type="checkbox" name="sport" value="soccer"> Soccer
<input type="checkbox" name="sport" value="baseball"> Baseball
To pull in every value that was selected, use an array:
my @sports = param('sport');
If you were to use a scalar (my $sport = ...), then param() would only return the
first sport
selected.
Cheers,
Curtis "Ovid" Poe
=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]