I am building a cgi web form that will be used for data requests. The form is nothing more than a series of checkboxes for the users to choose which elements they want in their data pull. I am using a pipe delimited flat file to
generate the list of checkboxes. The flat file looks
like this:
field|data_field1|value for data field 1
field|data_field2|value for data field 2
type|State=CA|state='CA'
type|State=OR|state='OR'
I loop through the file and push the different components
into a @fields and @types array so that they can be
seperated on the form.
my ($type,$name,$desc)=split/\|/;
$x=join ("|", ($name,$desc));
if (lc($type) eq "field"){
push @fields, $x;
}
elsif (lc($type) eq "type"){
push @types, $x;
}
...
...
...
foreach $f (@types){
($name,$desc)=(split/\|/,$f);
$desc=~s/\n//g;
$name=ucfirst($name);
print qq{<tr><td>$name</td>
<td><input type="checkbox" name="$name" value="$desc">
+</td>
</tr>};
}
What I need to do now if gather up the items that were
checked and put them into an email.
Since the list of parameters is ever changing I don't want
to hard code the names in. Is there a way to get this
list from the form without knowing the parameter
names and put the values into the body of an email quickly and efficiently?
Regards
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.