How many calories do you need each day?

Are you male or female?

>Male
>Female

What is your goal weight? ( pounds )
What is your height? ( inches )
What is your age? ( years )

What is your activity level on most days?

>Couch potato
>House work/office work/golf
>Walking/dancing/gardening/tennis
>Full time athlete/laborers

Target weight? "; $all_set = 0; } if ( empty($_POST['height'] )){ print "
What is your height? "; $all_set = 0; } if ( empty($_POST['years'] )){ print "
What is your age? "; $all_set = 0; } if ( empty($_POST['activity'] )){ print "
What is your activity level? "; $all_set = 0; } // do we have all the info we need? if ( $all_set ){ $calories = 0; //first pass calculate calorie need based on sex and age // women 655 + ( 4.4 * goal ) + ( 4.7 * height ) - ( 6.8 * age ) //men 66 + ( 6.2 * goal ) + ( 12.7 * height ) - ( 6.8 * age ) if ( $_POST['sex'] == "female" ){ $calories = 655 + ( 4.4 * $_POST['goalweight'] ) + ( 4.7 * $_POST['height'] ) - ( 6.8 * $_POST['years'] ); }else if ( $_POST['sex'] == "male" ){ $calories = 66 + ( 6.2 * $_POST['goalweight'] ) + ( 12.7 * $_POST['height'] ) - ( 4.7 * $_POST['years'] ); } //now adjust calorie needs based on activity levels if ( $_POST['activity'] == "not" ){ // couch potato $calories *= 1.3; } if ( $_POST['activity'] == "light" ){ //housework office golf $calories *= 1.5; } if ( $_POST['activity'] == "moderate" ){ //walk/dance/garden/tennis $calories *= 1.6; } if ( $_POST['activity'] == "very" ){ // athlete / laborer $calories *= 1.9; } //print results to the user print "\n

==> daily calories needed: $calories"; //print information to users print "\n


"; print "\n

In 1950 the average US woman was 35\", 27\", 38\", 5'3\" tall and weighed 140 pounds."; print "\n
In 2004 the average US woman was 41\", 34\", 43\", 5'4\" tall and weighed 154 pounds.

"; print "\n

In 1950 the average US man was 40\", 34\", 40\", 5'8\" tall and weighed 166 pounds."; print "\n
In 2004 the average US man was 44\", 38\", 42\", 5'9.5\", tall and weighed 191 pounds.

"; print "\n

In 1960 45% of the US was overweight, 13% was obese
"; print "\nIn 1999 65% of the US was overweight, 31% was obese

"; print "\n

Flour and cereals make up 21% of our diet, red meat 9%, fruit 9%, corn sweeteners 8%, lard 6%, soft drinks 5%

"; print "\n

To lose weight start small. Give up one thing a day; one soda, one snack, what ever works for you. To keep the weight off "; print "once you lose it step on the scale every morning. If you are male and you are 10 pounds over weight, or if you are female and 5"; print " pounds over weight, then it is back to the diet. It is far easier to lose a few pounds than many pounds."; print "



"; } } ?>