-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath_function.php
More file actions
46 lines (39 loc) · 893 Bytes
/
math_function.php
File metadata and controls
46 lines (39 loc) · 893 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>math function in PHP</title>
<style>
body{
text-align: center;
}
</style>
</head>
<body>
<form action="math_function.php" method="post">
<label>x:</label>
<input type="text" name="num1"><br><br>
<label>y:</label>
<input type="text" name="num2"><br><br>
<input type="submit" value="total">
</form>
</body>
</html>
<?php
$x = $_POST["num1"];
$y = $_POST["num2"];
$total = null;
//$total =abs($x);//give positive no
//$total =round($x);
//$total =floor($x);
//$total =ceil($x);
//$total =sqrt($x);
//$total =pow($x,$y);
//$total =max($x,$y);
//$total =min($x,$y);
//$total =pi();
//$total =rand();
//$total =rand($x,$y);
echo $total;
?>