l202/12.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
if($_GET['graden']){
$graden = $_GET['graden'];
$fahrenheit = berekening($graden);
echo "$graden graden is gelijk aan $fahrenheit fahrenheit";
}
else{
echo "Voer hier het aantal graden in";
}
function berekening($graden){
$b = $graden * 1.8 + 32;
return $b;
}
?>
<form method='get' action =''>
<input type='text' name='graden'>
<input type='submit' value='Omrekenen'>
</form>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse