2007-05-14 14:52:18醬菜♥
(暫貼)
BMI身體質量指數
$tall = $_POST[’tall’]/100;
$weight = $_POST[’weight’];
if($tall !=""&& $weight !="" )
{
$bmi = $weight/($tall*$tall);
echo"您的BMI為".round($bmi,2)."
";
if($bmi >=35)
{echo"重度肥胖";}
elseif($bmi >=30 && bmi <35)
{echo "中度肥胖";}
elseif($bmi >=27 && bmi <30)
{echo "輕度肥胖";}
elseif($bmi >=24 && bmi <27)
{echo "過重";}
elseif($bmi >=18.5&& bmi <24)
{echo "正常範圍";}
else{echo"體重過輕";}
}
?>
PHPˊ皿ˋ