Thank You
The easiest way to accomplish what you want is to simply change the names of the inputs in your form to reflect the text you want to appear in the email you are sent. You would need to ensure that you form processor handles these though, in case is not set up to accept all of the data that is sent from your form.
Thanks.
"..I have done more with flash, so cgi is a fairly new arena for me.."
The only thing the two have in common are that they are both done on a computer, (perl and flash).
A lot of questions, but since you seem to not know where to look, I'll just give you some clues.
Important Question:
1. Is one single perl script creating the form AND collecting the data AND sending the email?
If so, you can open the file with a text editor and check for the following;
You will need to know if the script processes all value=name pairs in the query string or was written to only handle certain pairs.
It may use the CGI perl module;
#
use CGI;
$query = new CGI;
#
$varname1 = ($query->param("varname1"));
$varname2 = ($query->param("varname2"));
$somelabel = ($query->param("somelabel"));
$person = ($query->param("person"));
$place = ($query->param("place"));
$thing = ($query->param("thing"));
#
or it may use perl native functions to parse out the CGI name=value pairs;
#
if ($ENV{'QUERY_STRING'}) {
$buffer = $ENV{'QUERY_STRING'};
} elsif ($ENV{'CONTENT_LENGTH'}) {
read (STDIN,$buffer,$ENV{'CONTENT_LENGTH'});
}
@cgiPairs = split(/&/,$buffer);
foreach $cgiPair (@cgiPairs) { ($name,$value) = split(/=/,$cgiPair);
$value =~ s/\+/ /g;
}
#
If it is parsing out any pairs regardless of label (name) and value, you can just move ahead to reformatting the data.
If it specifically declares each name=value pair, (using ($query->param("label")), you will need to rework those lines of code to match what you are doing in the (HTML form) INPUT name= markup.
...either way, you will need to handle each name=value pair and reformat the data before it is sent as email.
Somewhere in the script, there is probably some code that looks like:
#
open (MAIL,"¦$mailprog -t") ;
print MAIL "To: $webmaster\nFrom: web_form@domain.tld\n";
print MAIL "Subject: Stuff from form\n";
print MAIL "THIS WAS SENT FROM FORM:\n\n$label1: $var1\n\n$label2: $var2\n\$label3: $var3\n\$label4: $var4\n\$label5: $var5\n\n";
close (MAIL);
#
You would need to reformat the data and replace the line that reads "THIS WAS SENT FROM FORM...".
For instance, you could do:
#
if $label eq 'perilinsur') {
$new_label1 = 'Does property have peril insurance';
}
#
Then use $new_label1 in the print MAIL line...
Hope this helps.
if ($useLib eq "sendmail") {
#############################################
# ABOVE CHECKS WHAT SEND TYPE TO USE #
#############################################
$msgSubject = "Novice Form Submission" . "$POST{'subject'}";
open(MAIL, "¦$mailprog -t") ¦¦ die "Can't open $mailprog!\n";
print MAIL "To: $sendto\n";
if ($ccto){
print MAIL "Cc: $ccto\n";
}
print MAIL "From: $POST{'email'}\n";
print MAIL "Subject: $msgSubject\n";
print MAIL "The form below was submited by $POST{'email'} form Ip address: $ENV{'REMOTE_ADDR'} on $monthnameactual $dayofmonth, $year at $newhour:$newmin\n";
print MAIL "-------------------------------------------------------------------------\n\n";
if (! $POST{'sort'}) {
for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];
if (${'myname'} eq "subject" ¦¦ ${'myname'} eq "required" ¦¦ ${'myname'} eq "sort" ¦¦ ${'myname'} eq "success_page" ¦¦ ${'myname'} eq "ccto" ¦¦ ${'myname'} eq "sendto"){
$dontrun = "1";
}else{
$dontrun = "";
}
if (! $dontrun){
print MAIL "${'myname'}: ${'myvalue'} \n\n";
}
}
}else{ ##ELSE IF NO SORT FIELD ##
for ($numsort = 0; $numsort < @sortfields; $numsort++) {
$sfield = $sortfields[$numsort];
${'sfieldvalue'} = $POST{"$sfield"};
${'sfield'} = "$sfield";
print MAIL "${'sfield'}: ${'sfieldvalue'} \n\n";
}
} ## END ELSE IF SORT FIELD ##
close MAIL;
HTML:
Tornado: <br>
<input name="tordis" value="Extremely Concerned" type="radio">Extremely
Concerned <input name="tordis" value="Very Concerned" type="radio">Very
Concerned <input name="tordis" value="Concerned" type="radio">Concerned
<input name="tordis" value="Somewhat Concerned" type="radio">Somewhat
Concerned <input name="tordis" value="Not Concerned" type="radio">Not
Concerned <br>
<br>
Flood:<br>
<input name="flooddis" value="Extremely Concerned" type="radio">Extremely
Concerned <input name="flooddis" value="Very Concerned" type="radio">Very
Concerned <input name="flooddis" value="Concerned" type="radio">Concerned
<input name="flooddis" value="Somewhat Concerned" type="radio">Somewhat
Concerned <input name="flooddis" value="Not Concerned" type="radio">Not
Concerned <br>
What is the most effective way for you to receive information on how to
make your home safer?<br>
<table style="width: 100%; text-align: left;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Newspaper" type="radio">Newspaper<br>
</td>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Television" type="radio">Television<br>
</td>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Radio" type="radio">Radio<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Mailings" type="radio">Mailings<br>
</td>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Internet" type="radio">Internet<br>
</td>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Schools/Universities" type="radio">Schools/Universities<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Outdoor Advertisement" type="radio">Outdoor Advertisement<br>
</td>
<td style="vertical-align: top;"><input name="effectiveinfo"
value="Other" type="radio">Other<br>
</td>
<td style="vertical-align: top;"><br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
Does your household have insurance for open-perils(fire, wind, rain)?<br>
<input name="openperilsinsurance" value="Yes" type="radio">Yes <input
name="openperilsinsurance" value="No" type="radio">No<br>
<br>
If NO, what is the main reason for not having open-peril insurance?<br>
<table style="width: 100%; text-align: left;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;"><input name="openperilreason"
value="Too expensive" type="radio">Too Expensive<br>
</td>
<td style="vertical-align: top;"><input name="openperilreason"
value="Not necessary" type="radio">Not Necessary<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;"><input name="openperilreason"
value="Never considered it" type="radio">Never Considered it<br>
</td>
<td style="vertical-align: top;"><input name="openperilreason"
value="Deductible is too high, not worth it" type="radio">Deductible
is too high, not worth it<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;"><input name="openperilreason"
value="Not familiar with it" type="radio">Not familiar with it<br>
</td>
<td style="vertical-align: top;"><input name="openperilreason"
value="Other" type="radio">Other<br>
</td>
</tr>
</tbody>
</table>
<br>