Are your height and weight compatible?
<%
Weight = Request("Weight")
If Weight = "" then
Error = "Please enter a correct weight. "
End If
If not IsNumeric(Weight) then
Error = "Please enter a correct weight. "
End If
If Instr(Weight, "E") or Instr(Weight, "e") or Instr(Weight, "D") or Instr(Weight, "d") then
Error = "Please enter a correct weight. "
End If
If Weight = "" Or Error > "" then%>
Body Mass Index (BMI) is a measure of a person's weight in relation to height, not body composition.
BMI values apply to both men and women, regardless of age or frame size. Use this information, along with other health indices, to assess your need to adjust your weight.
A BMI score between 20 and 25 is considered ideal. A score below 18.5 indicates underweight while a score between 25 and 29 indicates overweight. Experts consider a score of 30 or higher an indicator of obesity. These values do not apply to athletes and body builders, pregnant and nursing women, the frail or elderly or people under 18.
<%Else%>
Thank you for using Fitness Online's BMI Calculator.
A BMI score between 20 and 25 is considered ideal. A score below 18.5 indicates underweight while a score between 25 and 29 indicates overweight. Experts consider a score of 30 or higher an indicator of obesity. These values do not apply to athletes and body builders, pregnant and nursing women, the frail or elderly or people under 18.
Need to improve your fit quotient? Browse Fitness Online's Get Fit and Eat Healthy areas to get on the path to feeling and looking better - and staying healthy.
<%End If%>
|
|
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
Response.Write "Your Results:"
else
Response.Write "Let's get started."
end if
%>
<%
Dim Feet, Inches, Weight, Message, Alone, Error, BMI, Height, Kilograms
Error = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" then
Feet = Request("Feet")
Inches = Request("Inches")
Weight = Request("Weight")
If Weight = "" then
Error = "Please enter a correct weight. "
End If
If not IsNumeric(Weight) then
Error = "Please enter a correct weight. "
End If
If Instr(Weight, "E") or Instr(Weight, "e") or Instr(Weight, "D") or Instr(Weight, "d") then
Error = "Please enter a correct weight. "
End If
If Error = "" then
Kilograms = Weight * 703
Height = ((Feet * 12) + Inches) ^ 2
BMI = Kilograms/Height
If Instr(BMI, ".") then
BMI = Mid(BMI, 1, (Instr(BMI, ".") + 1))
End If
If BMI < 18.5 then
Message = "Your score indicates you are underweight. You may wish to consult with your healthcare professional or nutritionist to discuss whether any health risks are associated with being underweight."
ElseIf BMI >= 18.5 and BMI <= 24.9 then
Message = "Your score indicates you have a healthy body fat ratio. Congratulations! You're right on track!"
ElseIf BMI >= 25 and BMI <= 29.9 then
Message = "Your score indicates you are overweight."
ElseIf BMI >= 30 then
Message = "Your score indicates moderate to severe obesity. Although weight loss can be difficult, even a modest weight loss of 10 to 20 pounds can bring significant health improvements, such as lowering ones' blood pressure and cholesterol levels."
End If
End If
End If
%>
<%
If BMI = "" or Error > ""then%>
<%If Error > "" then%>
<% = Error%>
<%End If%>
<%Else%>
<% = Feet%>'<% = Inches%>", <% = Weight%> pounds.
Your BMI score is: <% = BMI%>
<% = Message%> |
<%End If%>
|
|