|
| A R C H I V E D M E S S A G E |
|
Subject: Calculations script |
| Posted: 04/16/2004 at 4:28:26 am |
| By: erpjane |
| Hi again,
I'm trying to do some calculations from a form. I'm doing some points for users e.g.
From the html form i put
Pointlimit: "pointlimit"
pointused: "point used"
where "" is the field
in the cgi script how would i put
$point total = pointlimit - pointused?
Thank you | |
|
|
Subject: Re: Calculations script |
| Posted: 04/16/2004 at 6:12:19 am |
| By: Seth Knorr |
| The exact way to do it would be thus:
in the Biz Mail Form scripting all posted variables equal: $formdata{'name'}
with: name
being the name="" of the form field
So to caculate it would be:
$point_total=$formdata{'pointlimit'}-$formdata{'pointused'};
The scalar variables like: $point_total
can not contain spaces or you will get an internal server error.
so: $point total
for instance would not work...
Seth | |
|
|
Subject: Re: Calculations script |
| Posted: 04/16/2004 at 7:22:41 am |
| By: erpjane |
| ah thx, i put spaces by mistake and got in a test mail 0 at the end of it. | |
|
|
Subject: Re: Calculations script |
| Posted: 07/20/2004 at 2:12:58 pm |
| By: Seth Knorr |
| Yes, you can run that calculation, however you need to stick that code below:
sub main {
IN bizmail.cgi
Of course from there you would have to put that field in the other parts of the script where you want it to work, or be emailed to you.
Seth
P.S. I also added this to your other post. | |
|
|
Subject: Re: Calculations script |
| Posted: 07/20/2004 at 12:42:30 pm |
| By: erpjane |
| Hey,
I'm trying to perform a similar function, and I think I understand the variables...I'm just not sure exactly which page I need to type them into. For example, I'll be needing to add
$order_subtotal=$formdata{'item1_total'}+$formdata{'item2_total'}+$formdata{'item3_total'}+$formdata{'item4_total'}+$formdata{'item5_total'}+$formdata{'item6_total'};
Would this need to be typed into the bizmail.cgi form? Or am I way off?
Thanks for any help! :-)
Michelle Bailey | |
|
|