RE: finishing a form, again
by "Buddy Harris" <bharris(at)stny.rr.com>
|
Date: |
Fri, 2 Jun 2000 09:41:40 -0400 |
To: |
"HWG Email List" <hwg-techniques(at)hwg.org> |
|
todo: View
Thread,
Original
|
|
: Hi All
: I have a form that uses the cgi program mailform1. Instead of sending the
: user to a "thank you" page, I like to total the cost of thier order and
: send them to a "thank you" page.
: Will mailform1 do this for me?
: TIA, John
Hi John,
If mailform1 is a perl program, you can use:
(In your form)-> <input type="checkbox" name="item1" value="137.65">
(In your cgi)->
$item1 = $FORM{'item1'};
$item2 = $FORM{'item2'};
$totl = $item1 + $item2; #etc.
print "Thank You!<br> Here is your total.\n";
if ($FORM{'item1'}) {
print "Red Widget: ";
print "\$";
$# = '%.2f'; #For two decimal places.
$item$FORM{'item1'};
print "<br>\n";
}
if ($FORM{'item2'}) {
print "Green Widget: ";
print "\$";
$# = '%.2f'; #For two decimal places.
$item$FORM{'item2'};
print "<br>\n";
}
print "TOTAL: ";
print "\$";
$# = '%.2f'; #For two decimal places.
print "$totl\n";
HTH,
Buddy
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA