30 lines
566 B
PHP
30 lines
566 B
PHP
|
<!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>
|
||
|
|