l208/opdrachten/11.2.php

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <?php $age = $_GET['age']; $class= $_GET['class'] ; if($age && $class){ echo "jou leeftijd is $age en je zit in klas $class"; } else if ($age || $class) { echo "je hebt niet alles ingevuld"; } echo "<form method='get' action=''> <div>leeftijd: <input type='text' name='voornaam' value='$age'></div> <div>klas: <input type='text' name='achternaam' value='$class'></div> <p><input type='submit' value='Verzenden'></p>"; ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse