<?php
error_reporting(0);
$xm1=$_POST['xm1'];
$xm2=$_POST['xm2'];
echo 'BMI:'.$xm1/($xm2*$xm2);
?>
<form method="post"><input type="" name="xm1" placeholder="体重(公斤)" value="<?php echo $xm1;?>"><input type="" name="xm2" placeholder="身高(米)" value="<?php echo $xm2;?>"><input type="submit" name="">
</form>
BMI在18.5以下被认为是偏瘦,18.5-24.9为正常范围,25-29.9为超重,30及以上为肥胖