Assistance needed with code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lantafly
Forum Newbie
Posts: 2
Joined: Sat Jun 21, 2008 3:55 am

Assistance needed with code

Post 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!
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Assistance needed with code

Post by Kieran Huggins »

Code: Select all

$fee = ($_POST['AdultShirtQnty']+$_POST['YouthShirtQnty'])*7;
lantafly
Forum Newbie
Posts: 2
Joined: Sat Jun 21, 2008 3:55 am

Re: Assistance needed with code

Post by lantafly »

Awesome! Thanks for the speedy reply.
Post Reply