-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmax3.php
More file actions
42 lines (33 loc) · 956 Bytes
/
Copy pathmax3.php
File metadata and controls
42 lines (33 loc) · 956 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
<!DOCTYPE html>
<html>
<head>
<title>Maximum of Three Numbers</title>
</head>
<body>
<h2>Find the Maximum of Three Numbers</h2>
<form method="post">
<label>Enter first number:</label>
<input type="number" name="num1" required><br><br>
<label>Enter second number:</label>
<input type="number" name="num2" required><br><br>
<label>Enter third number:</label>
<input type="number" name="num3" required><br><br>
<input type="submit" name="submit" value="Find Maximum">
</form>
<?php
if (isset($_POST['submit'])) {
$a = $_POST['num1'];
$b = $_POST['num2'];
$c = $_POST['num3'];
$max = $a;
if ($b > $max) {
$max = $b;
}
if ($c > $max) {
$max = $c;
}
echo "<h3>The maximum of $a, $b, and $c is: $max</h3>";
}
?>
</body>
</html>