<?php
If ( isset ($_POST['name'] ) ) {
$name = $_POST['name'];
if (!empty ($name)) {
$sentence = $name . " is the best footballer of his generation. ";
} else {
echo "Please enter a name";
}
}
?>
<html>
<head>
</head>
<body>
<!-- ********************************** -->
<form action="form3.php" method="POST">
Name: <input type="text" name="name"><br>
<input type="submit" value="Send">
</form>
<textarea rows="7" cols="30"> <?php echo $sentence; ?> </textarea>
</body>
</html>
コードは問題なく動作しますが、何らかの理由でテキストエリア内のテキストにこのエラーが表示されます
注意: 未定義の変数: C:\xampp\htdocs\form3.phpの29行目の文