l101/opdrachten/H11/11.2.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
$naam = $_GET['naam'];
$uurloon = $_GET['uurloon'];
$werkuren = $_GET['werkuren'];
$salaris = salaris($uurloon, $werkuren);
function salaris($bedrag, $uren){
$x = $bedrag * $uren;
return $x;
}
echo "Uw salaris per week is $salaris"
?>
<form method="get">
<div>Naam:<input type="text" name="naam" value="<?php echo "$naam"?>"></div>
<div>Uurloon:<input type="text" name="uurloon" value="<?php echo "$uurloon"?>"></div>
<div>Uren per week dat u werkt:<input type="text" name="werkuren" value="<?php echo "$werkuren"?>"></div>
<input type="submit" name="verstuur">
</form>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse