最近我的网络服务器从 PHP v.4 迁移到 v.5.3。我知道,我知道,好久不见:)
但是现在当用户输入所需的数据时,我的一些脚本不会显示结果。这是脚本:
<?php
if ($ok) {
if ($heightft == "" || $heightin == "" || $weight == "") {
$error = "<br><FONT COLOR=#FF0000>One of the fields above was not completed.</FONT><br>";
} else {
$bmi = $weight * 703 / (($heightft * 12 + $heightin) * ($heightft * 12 + $heightin));
$bmiString = number_format($bmi,2,".","");
echo "<table border='1' cellpadding='10' bordercolor='0000FF'><tr><td><strong>Your BMI is: " . $bmiString;
echo "<br><br></strong>";
if ($bmi <= 18.50) {
echo "You are classified as <strong>Underweight</strong>.";
} elseif ($bmi <= 24.99) {
echo "You are classified as <strong>Normal</strong>.";
} elseif ($bmi <= 29.99) {
echo "You are classified as <strong>Overweight</strong>.";
} else {
echo "You are classified as <strong>Obese</strong>.</td></tr></table></bordercolor>";
}
}
}
?>
<?php echo $error;?>