-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
88 lines (73 loc) · 2.43 KB
/
index.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
77
78
79
80
81
82
83
84
85
86
<?php
include "head.php";
include "calculator.php";
include_once "function.php";
?>
<body>
<form action="calculator.php" method="post">
<br>
<div class="container">
<div class="row">
<div class="col-sm">
<h2>Calculator</h2>
numberOne: <input type="number" name="numberOne"><br>
numberTwo: <input type="number" name="numberTwo"><br>
</div>
<div class="col-sm">
<h2>Quadratic Solver</h2>
a: <input type="number" name="a"><br>
b: <input type="number" name="b"><br>
c: <input type="number" name="c"><br>
</div>
<div class="col-sm border-dark" >
<h2>Quadratic Solver Result</h2>
<button type="submit" class="btn btn-primary" name="quad">Solve</button>
Eredmény:
<?php
if (isset($_SESSION['quad_result']))
echo $_SESSION['quad_result'];
?>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col border border-dark" >
<button type="submit" class="btn btn-primary" name="add">Addition</button>
Eredmény:
<?php
if (isset($_SESSION['add_result']))
echo $_SESSION['add_result'];
?>
</div>
<div class="col border border-dark">
<button type="submit" class="btn btn-primary" name="sub">Subtraction</button>
Eredmény:
<?php
if (isset($_SESSION['sub_result']))
echo $_SESSION['sub_result'];
?>
</div>
<div class="border border-dark w-100"></div>
<div class="border border-dark col">
<button type="submit" class="btn btn-primary" name="multi">Multiplication</button>
Eredmény:
<?php
if (isset($_SESSION['multi_result']))
echo $_SESSION['multi_result'];
?>
</div>
<div class="border border-dark col">
<button type="submit" class="btn btn-primary" name="divide">Divide</button>
Eredmény:
<?php
if (isset($_SESSION['divide_result']))
echo $_SESSION['divide_result'];
?>
</div>
</div>
<br>
</form>
<?php
include "footer.php";
?>