Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $height=$_POST["height"];
- $weight=$_POST["weight"];
- $changm=$height/100;
- $bmi=$weight/($changm*$changm);
- if ($bmi!=null) {
- echo "你的BMI值是".$bmi."<br/>";
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- <form name="form1" method="post" action="bmi.php">
- BMI計算<br/>
- 身高: <input type="text" name="height" size="30"/>cm<br/>
- 體重: <input type="weight" name="weight" size="30"/>kg<br/>
- <input type="submit" value="送出計算">
- <input type="reset" value="重設">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement