isp

Need a calorie calculator for a site I'm working on
Menu

Sun Oct 12 2008

Web-Mastery Webmaster Forum

Sun Oct 12 2008

Home

Need a calorie calculator for a site I'm working on


real easy. what is the formula? have the person enter their weight. multiply the weight times the calories and return them the total calories. this is a couple lines in PHP. let me know what the actual formula is and i can post the function for you.


My PHP guy said no problem too (depending on what you want).. but he needs to know... Do you want tracking... Do you want foods in there... Formula... etc....


odd that i was thinking of adding something like that to my weight loss website. like a BMI calculator. i have an outgoing link to the CDC's BMI calculator as it stands now, it would be better to have my own..i'm not much of a programmer myslf though. **i want it all, and i want it now** singing to Queen..dancing like a madwoman.. hahah


i think its the same thing as i told bigrob. post what the formula is and i can write a function which will do the calculation. i'm no master programmer but this isn't a real tough task. you can even turn it into a block since you're using it phpnuke.


:lol: *watching feathers sing and dance* I think Feathers had too much coffee this morning!


hehe.. i'm looking to pursue a career on "American Idol" i think with just a little work and a BMI calculator i can get it done.. **taking a bow as crowds clap and cheer**


i found several examples on the web, mainly javascript. but i'm not sure how they're making their computations. they have several variables like "activity level" that i don't know where they derived the formula from.


Oh okay. You want the actual "science" used for the calculations. I'll dig out some books and post later!


[quote:dc6069e026="BigRob"]Oh okay. You want the actual "science" used for the calculations. I'll dig out some books and post later![/quote:dc6069e026] You weren't kidding when you said "later". LOL :P


LOL! English Formula Body Mass Index can be calculated using pounds and inches with this equation BMI = ( Weight in Pounds (Height in inches) x (Height in inches) ) x 703 For example, a person who weighs 220 pounds and is 6 feet 3 inches tall has a BMI of 27.5. ( 220 lbs. (75 inches) x (75 inches) ) x 703 = 27.5 What Does This All Mean? This is from the [url=http://www.cdc.gov/nccdphp/dnpa/bmi/bmi-adult-formula.htm]CDC BMI for Adults page[/url]


you need a form to post two variables. one is height. one is inches. you declare 3 variables in the php script which returns one which the the bmi. something like this: [code:1:e25cca40ed] <?php $inches = $HTTP_POST_VARS['inches']; $weight = $HTTP_POST_VARS['weight']; $bmi = $inches X $weight x 730; echo "Your BMI is: $bmi"' ?> [/code:1:e25cca40ed] that's really all the code you need. you can make the form read however you want.


I would suggest using PHPSELF or an equivalent and keep the form self-referential so it displays on the input page.


Alright! After many months we can get this done. I'll try building the HTML form today. I can just call that snippet write from the HTML form, or can I? I'll goof around. Thanks!

Most Popular Stories
Broadband ISP