If you have a web site that deals with health or diet then here is a body fat calculator that may make a good addition to your site. The following body fat calculator uses the U.S. Navy Circumference Method where three or four body measurements are fed into a fixed formula to estimate the percentage of your body that is made up of fat. The measurements need to be accurate to within 0.5cm or 0.25 inches and should be taken as follows:
To install the calculator on your own site first download and unzip the files. You can then modify the bfat.php file that contains the form to add whatever other content that you want to appear on the same page or if you prefer you can copy and paste the various parts of that page into the page where you want to install the calculator.
Most of the code is needed to validate the values that your visitor enters into the form in order to make sure that the values are numeric and within a reasonable range. The actual calculations themselves (if you are interested in what those formula actually are) can be found in the maleFat() and femaleFat() functions.
This article written by Stephen Chapman, Felgall Pty Ltd.