add demo
This commit is contained in:
parent
305b772496
commit
7344d98415
29
demo/index.php
Normal file
29
demo/index.php
Normal file
@ -0,0 +1,29 @@
|
||||
<form method="post" action="lösung.php">
|
||||
|
||||
<h2>Welches Tier bellt?</h2>
|
||||
Hund: <input type="radio" name="frage-1" value="Hund">
|
||||
<br>
|
||||
Katze: <input type="radio" name="frage-1" value="Katze">
|
||||
<br>
|
||||
Biene: <input type="radio" name="frage-1" value="Biene">
|
||||
<br>
|
||||
|
||||
<h2>Welche Farbe ist der Himmel bei gutem Wetter?</h2>
|
||||
Rot: <input type="radio" name="frage-2" value="Rot">
|
||||
<br>
|
||||
Blau: <input type="radio" name="frage-2" value="Blau">
|
||||
<br>
|
||||
Grün: <input type="radio" name="frage-2" value="Grün">
|
||||
<br>
|
||||
|
||||
<h2>Welche Frucht ist Gelb?</h2>
|
||||
Banane: <input type="radio" name="frage-3" value="Banane">
|
||||
<br>
|
||||
Birne: <input type="radio" name="frage-3" value="Birne">
|
||||
<br>
|
||||
Kiwi: <input type="radio" name="frage-3" value="Kiwi">
|
||||
<br>
|
||||
|
||||
<button type="submit">Absenden</button>
|
||||
</form>
|
||||
|
31
demo/lösung.php
Normal file
31
demo/lösung.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
$antwort1 = $_POST['frage-1'];
|
||||
$antwort2 = $_POST['frage-2'];
|
||||
$antwort3 = $_POST['frage-3'];
|
||||
|
||||
?>
|
||||
<h2>Antwort 1 ist <?php
|
||||
if ($antwort1 === 'Hund') {
|
||||
echo 'richtig';
|
||||
} else {
|
||||
echo 'falsch';
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
<h2>Antwort 2 ist <?php
|
||||
if ($antwort2 === 'Blau') {
|
||||
echo 'richtig';
|
||||
} else {
|
||||
echo 'falsch';
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
<h2>Antwort 3 ist <?php
|
||||
if ($antwort3 === 'Banane') {
|
||||
echo 'richtig';
|
||||
} else {
|
||||
echo 'falsch';
|
||||
}
|
||||
?>
|
||||
</h2>
|
Loading…
Reference in New Issue
Block a user