l203/opdrachten/11.3.php

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <?php $age = $_POST['age']; $class= $_POST['class'] ; if($age && $class){ echo "Jou leeftijd is $age en je zit in klas $class"; } else { echo "Vul de formulier in:"; } echo "<form method='get' action=''> <div>Leeftijd: <input type='text' name='leeftijd' value='$age'></div> <div>Klas: <input type='text' name='klas' value='$class'></div> <p><input type='submit' value='Verzenden'></p>"; ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse