rekenmachine
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
if(empty($_POST["getal1"])){
$geen_user1 = "Veld is leeg";
}else{
if(is_numeric($_POST["getal1"])){
}else{
$geen1 = "Geen Cijfer";
}
}
print("<br/>");
if(empty($_POST["getal2"])){
$geen_user2 = "Veld is leeg";
}else{
if(is_numeric($_POST["getal2"])){
}else{
$geen2 = "Geen Cijfer";
}
}
?>
<form name="frm_rekenmachine" action="<?php print($_SERVER["PHP_SELF"]);?>" method="post">
<input type="text" name="getal1" value="<?php print($_POST["getal1"]);?>"> <?php print("$geen1") ?><?php print("$geen_user1") ?><br>
<select name="type">
<option value ="plus">+</option>
<option value ="min">-</option>
<option value ="delen">:</option>
<option value ="maal">x</option>
</select>
<br>
<input type="text" name="getal2" value="<?php print($_POST["getal2"]);?>"> <?php print("$geen2") ?><?php print("$geen_user2") ?>
<br>
<input type="submit" name="sub_nogiet" value="Reken uit">
</form>
<?php
$getal1 = $_POST["getal1"];
$getal2 = $_POST["getal2"];
if($_POST["type"] == "plus"){
$uitkomst = $getal1 + $getal2;
}else if($_POST["type"] == "min"){
$uitkomst = $getal1 - $getal2;
}else if($_POST["type"] == "delen"){
$uitkomst = $getal1 / $getal2;
}else if($_POST["type"] == "maal"){
$uitkomst = $getal1 * $getal2;
}
print($getal1);?>
<?php
if($_POST["type"] == "plus"){
?>+<?php
}else if($_POST["type"] == "min"){
?>-<?php
}else if($_POST["type"] == "delen"){
?>:<?php
}else if($_POST["type"] == "maal"){
?>x<?php
}
print($type2); ?> <?php print($getal2) ?> = <?php print("<b>$uitkomst</b>") ?>
if(empty($_POST["getal1"])){
$geen_user1 = "Veld is leeg";
}else{
if(is_numeric($_POST["getal1"])){
}else{
$geen1 = "Geen Cijfer";
}
}
print("<br/>");
if(empty($_POST["getal2"])){
$geen_user2 = "Veld is leeg";
}else{
if(is_numeric($_POST["getal2"])){
}else{
$geen2 = "Geen Cijfer";
}
}
?>
<form name="frm_rekenmachine" action="<?php print($_SERVER["PHP_SELF"]);?>" method="post">
<input type="text" name="getal1" value="<?php print($_POST["getal1"]);?>"> <?php print("$geen1") ?><?php print("$geen_user1") ?><br>
<select name="type">
<option value ="plus">+</option>
<option value ="min">-</option>
<option value ="delen">:</option>
<option value ="maal">x</option>
</select>
<br>
<input type="text" name="getal2" value="<?php print($_POST["getal2"]);?>"> <?php print("$geen2") ?><?php print("$geen_user2") ?>
<br>
<input type="submit" name="sub_nogiet" value="Reken uit">
</form>
<?php
$getal1 = $_POST["getal1"];
$getal2 = $_POST["getal2"];
if($_POST["type"] == "plus"){
$uitkomst = $getal1 + $getal2;
}else if($_POST["type"] == "min"){
$uitkomst = $getal1 - $getal2;
}else if($_POST["type"] == "delen"){
$uitkomst = $getal1 / $getal2;
}else if($_POST["type"] == "maal"){
$uitkomst = $getal1 * $getal2;
}
print($getal1);?>
<?php
if($_POST["type"] == "plus"){
?>+<?php
}else if($_POST["type"] == "min"){
?>-<?php
}else if($_POST["type"] == "delen"){
?>:<?php
}else if($_POST["type"] == "maal"){
?>x<?php
}
print($type2); ?> <?php print($getal2) ?> = <?php print("<b>$uitkomst</b>") ?>