Page 1 of 1

Assistance needed with code

Posted: Sat Jun 21, 2008 4:05 am
by lantafly
I'm trying to add two variable totals, then multiply them by another number to return a total.

Here's the snippet of code that I want to configure to return the calculation:

$fee = ('AdultShirtQnty'+'YouthShirtQnty')*7;

I have a form that allows a number to be selected from a drop down menu for AdultShirtQnty and YouthShirtQnty. I want these two numbers to be multiplied by "7" as the total "fee".

Hope my interpretation is not too confusing.

Thanks in advance!

Re: Assistance needed with code

Posted: Sat Jun 21, 2008 4:11 am
by Kieran Huggins

Code: Select all

$fee = ($_POST['AdultShirtQnty']+$_POST['YouthShirtQnty'])*7;

Re: Assistance needed with code

Posted: Sat Jun 21, 2008 4:28 am
by lantafly
Awesome! Thanks for the speedy reply.