私は最近PHPを開始しましたが、その結果はecho
でした。どんな助けもありがとう。ユーザー入力に基づいて計算結果を出力しようとするとエラーが発生しました
<html>
<head>
<style>
input[type=submit]{
background-color: #4CAF50;
border: none;
color: white;
padding: 16px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
}
input[type=text]{
border: 3px solid black;
}
</style>
</head>
<body>
<form action="fitness1.php" method="post">
<b>weight:</b> <input type="text" name="weight"><br>
<br>
<b>height:<b> <input type="text" name="height"><br>
<br>
<input type="submit">
</body>
</html>
これは、PHPのコードです:
<html>
<body>
<?php
$WEight = $_Post['weight'];
$HEight = $_post['height'];
if (is_numeric($WEight)&& is_numeric($HEight)){
$bmi= $WEight/$HEight * $HEight;
}
echo ("$bmi");
else {
echo "please enter your weight and height";
}
?>
</body>
</html>
エラーは何ですか? – Will
構文解析エラー:構文エラー、予期しない '}'、予期している '、'または ';' G:\ wamp \ www \ test \ fitness1.php(ライン19) –
エコーBMI行がその行の後に来る前に、中括弧を移動します。 –