$answer2 = $_POST['question-2-answers'];
$totalCorrect = 0;
if ($answer1 == "B") { $totalCorrect++; }
if ($answer2 == "A") { $totalCorrect++; }
echo "<h2> Total Score : $totalCorrect / 4 </h2>";
?>
Please format the code you posted, by wrapping it in triple backticks. -> `
Put all of it in if block if server method equal to post, syntax is written above
Обсуждают сегодня