-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrade Checker.php
40 lines (34 loc) · 1.05 KB
/
Grade Checker.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Student Grade Checker</title>
</head>
<body>
<?php
// Handle form submission
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$marks = $_POST["marks"];
echo "<h2>Student Grade:</h2>";
// Check the conditions and determine the grade
if ($marks >= 60) {
echo "Grade: First Division";
} elseif ($marks >= 45 && $marks <= 59) {
echo "Grade: Second Division";
} elseif ($marks >= 33 && $marks <= 44) {
echo "Grade: Third Division";
} else {
echo "Grade: Fail";
}
}
?>
<!-- Form to take marks from the user -->
<form method="post" action="">
<label for="marks">Enter marks:</label>
<input type="number" id="marks" name="marks" required>
<br>
<input type="submit" value="Check Grade">
</form>
</body>
</html>