Итак, я сделал тест, используя html, и теперь мне нужно использовать скрипт php, чтобы сделать функцию викторины такой, чтобы был доступен только вопрос, и как только на этот вопрос ответили, появится следующий вопрос. Поэтому, когда пользователь запускает тест, появляется только первый вопрос, а затем, когда на него появляется ответ, появляется второй. А потом после последнего. Я включил свой html код внизу. И мой php скрипт. Сценарий php направлен в правильном направлении, если нет, что я делаю неправильно и как я могу это исправить?
<!DOCTYPE html>
<html>
<head>
<title>Test your Math Skills!</title>
<link href ="style.css" rel ="stylesheet">
</head>
<body>
<div class="container">
<div id="question-container" class="hide">
<h1><center><u> Are You Smarter Than A Fifth Grader?
</center></h1></u>
<img id = "image" src = "Photos/gameLogo.jpg" style = "width:400px;height:300px;">
</div>
<form action="script.php" method="post">
<p class = "questions">What ocean is Japan apart of?</p>
<input type = "radio" name = "q1" value = "Arctic"> Arctic<br>
<input type = "radio" name = "q1" value = "Pacific"> Pacific<br>
<input type = "radio" name = "q1" value = "Atlantic"> Atlantic<br>
<input type = "radio" name = "q1" value = "Indian"> Indian<br>
<input type="submit" name="submit" />
<p id = "question2" style = display:none> How many feet are in a mile?<br>
<input type = "radio" name = "q2" value = "1280"> 1280<br>
<input type = "radio" name = "q2" value = "3280"> 3280<br>
<input type = "radio" name = "q2" value = "2280"> 2280<br>
<input type = "radio" name = "q2" value = "5280"> 5280<br>
<input type="submit" name="submit" />
<p id = "question3" style = display:none> What is something that is always arriving but never comes? <br>
<input id = "textbox" type = "text" name = "q3">
<input type="submit" name="submit" />
</form>
</html>
</body>
Это сценарий:
if ($_POST['submit'] )
{
echo $question2;
}
?>