Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: reading dynamic form params

by sulfericacid (Deacon)
on Dec 12, 2006 at 19:13 UTC ( #589365=note: print w/ replies, xml ) Need Help??


in reply to reading dynamic form params

Tested and works but there's probably a better solution.

my @names = param(); my %data; foreach my $name (@names) { next if ($name =~ m/SubmitButtonName/); $data{$name} = param($name);; } foreach my $key (keys %data) { print "$key => $data{$key}<br>\n"; } # all goodies are in %data
UPDATE: I decided to go ahead and try to load the hash to the param directly thinking perhaps there's a chance, but it failed. It stored just the params and not the values.
#!/usr/bin/perl use strict; use warnings; use CGI qw/:standard/; use CGI::Carp 'fatalsToBrowser'; print header, start_html; my %data = param(); foreach my $key (keys %data) { print "$key => $data{$key}<br>\n"; }


"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

sulfericacid


Comment on Re: reading dynamic form params
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2015-07-28 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls