sub getdata { # $_ is the form element name and $in{$_} is the contents.
if ($action eq $SENDSTR) {
open(OUT,">>$xls_file") || print "could not open $xls_file" ;
}
foreach ($query->param)
{
$in{$_} = $query->param($_);
if ($_=~/^c_/) { $check{$_}="CHECKED" } #checkbox
if ($_=~/^r_/) { $check{$_.$in{$_}}="CHECKED" } #radio
if ($_=~/^s_/) { $check{$_.$in{$_}}="SELECTED" } #Select
if ($action eq $SENDSTR) {
$in{$_}=~s/\r\n/ /g;
if ($_ !~/action|lang/) { # don't print these fields to XLS file
print OUT "$in{$_}\t";
}
}
$in{$_}=~s/\r\n/
/g || $in{$_}=~s/
/\n/g;
$in{$_}=~s/"/"/g;
$in{$_}=~s/'/’/g;
$in{$_}=~s/\$/&\#36;/g;
} # end foreach
if ($action eq $SENDSTR) {
print OUT "$today\t";
print OUT "\n";
close(OUT);
}
}