l207/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'] ; $contr = contributie($age, $class); echo "De contributie is $contr"; function contributie($leeftijd, $klasse){ $c = 200 + $leeftijd * 2 - $klasse * 3; return $c; } 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