If you have a web site that deals with health or diet then here is a BMI calculator that may make a good addition to your site. For those looking at this calculator not familiar with body mass index, it is the the ratio of body weight to the square of your height and is a general indication of whether someone is overweight.
To install the calculator on your own site first download and unzip the files. You can then modify the bmi.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 calculation only requires a single line of code.
This article written by Stephen Chapman, Felgall Pty Ltd.