in reply to Converting large numbers of checkboxes to small number of params
This will return a hash (%webparams2) containg an entry for every checkbox that was checked when the form was submitted. The keys will be the names of the checkboxes. Now you can just loop through the hash or use map to create your database statement.if ($ENV{'QUERY_STRING'} ne '') { # for get requests $webparams = "$ENV{'QUERY_STRING'}"; } else { # for post requests (you should always use post) read(STDIN, $webparams, $ENV{'CONTENT_LENGTH'}); } $webparams =~ s/\&/\n/g; $_ = $webparams; %webparams2 = /^(.*?)=(.*)$/gm;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Converting large numbers of checkboxes to small number of params
by ChrisR (Hermit) on Jul 09, 2003 at 21:08 UTC |