-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperator.php
More file actions
43 lines (42 loc) · 1.26 KB
/
operator.php
File metadata and controls
43 lines (42 loc) · 1.26 KB
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
<form method="post">
<span class="row align">Welcome</span>
<span class="row"><span class="cols">Please enter the first number :</span><span class="cols"><input type="text" name="fnum">
</span></span>
<span class="row"><span class="cols">pleas enter the second number :</span><span class="cols"><input type="text" name="snum">
</span></span>
<span class="row"><span class="cols"><input type="submit" value="Test"></span></span>
</form>
<?php
$firstnum=$_POST['fnum'];
$secondnum=$_POST['snum'];
?>
<label class="output">using the addition operator</label><br>
<span class="output">
<?php
echo $firstnum + $secondnum;
?>
</span>
<br><label class="output">using the subtraction operator</label><br>
<span class="output">
<?php
echo $firstnum - $secondnum;
?>
</span>
<br><label class="output">using the multiplication operator</label><br>
<span class="output">
<?php
echo $firstnum * $secondnum;
?>
</span>
<br><label class="output">using the division operator</label><br>
<span class="output">
<?php
echo $firstnum / $secondnum;
?>
</span>
<br><label class="output">using the modulus operator</label><br>
<span class="output">
<?php
echo $firstnum % $secondnum;
?>
<a href="index.php">Back</a>