-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath.php
executable file
·68 lines (52 loc) · 1.42 KB
/
math.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
<!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>
<form action="math.php" method="post">
<label for="">x:</label>
<input type="text" name="x"><br>
<label for="">y:</label>
<input type="text" name="y"><br>
<label for="">z:</label>
<input type="text" name="z">
<input type="submit" value="total">
</form>
</body>
</html>
<?php
$x = $_POST["x"];
$y = $_POST["y"];
$z = $_POST["z"];
//absolute value function - abs();
// $total = abs($x);
//round function - round();
// $total = round($x);
//floor (always round down) function floor();
// $total = floor($x);
//ceiling function (always round up)
// $total = ceil($x);
//pow function - pow();
// $total = pow($x, $y);
// echo "
// x: {$x} <br>
// y: {$y} <br>
// x^y: {$total}";
//square root function - sqrt()
// $total = sqrt($x);
// echo "<br> the the square root of x is: {$total}";
//max function - max()
// $total = max($x, $y, $z);
// echo "the max is: {$total}";
//min function - min()
// $total = min($x, $y, $z);
// echo "the min is: {$total}";
//pi function (print pi) - pi()
// $total = pi();
// echo $total;
//random function - rand()
// echo rand(1, 6);
?>