m1/www/public/upp5/result.php

30 lines
566 B
PHP
Raw Permalink Normal View History

2024-09-03 12:50:13 +00:00
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8" />
<title>Quiz med Formulär och PHP</title>
</head>
<body>
<h1>Resultat</h1>
<?php
$points = 0;
$ansOne = $_POST['qOne'];
$ansTwo = $_POST['qTwo'];
$ansThree = $_POST['qThree'];
$ansFour = $_POST['qFour'];
if($ansOne == '2005')
$points++;
if($ansTwo == 'sep')
$points++;
if($ansThree == 'two')
$points++;
if($ansFour == 'valter')
$points++;
echo '<strong>Du fick '.$points.' av 4 möjliga</strong>';
?>
</body>
</html>