<table align = "left">
<?php
if ($_POST["word"] == "ship" )
{
echo "Your answer is correct.";
}
else
{
echo "Sorry, you typed the wrong answer. Try Again!";
}
?>
<tr>
<td> <span id="dummy" onclick="playSound(this,'vowels/ship.mp3');">
<img src="pics/i.jpg" onmouseover="this.src='pics/vowel/ship.jpg';this.width=200;this.height=250" onmouseout="this.src='pics/i.jpg';this.width=100;this.height=150"/>
<form action="act_vowel.php" method="post">
<h2> <font color = "black"> Type the word: <input type="text" name="word"> </h2> </font>
<input type="submit" name="check" value="Answer">
</form>
当我运行这段代码时。我总是收到这样的错误:
(Notice: Undefined index: word in C:\xampp\htdocs\dyslexia\sample.php on line 15
Sorry, you typed the wrong answer. )
当用户输入答案时,我如何设计结果?我想让它更生动。谢谢!