-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
74 lines (74 loc) · 2.39 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TPC HOME</title>
<link rel="stylesheet" href="style.css">
<style>
.form input[type="submit"] {
background-color: #27ae60;
color: #fff;
border: none;
border-radius: 5px;
padding: 10px 20px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.form input[type="submit"]:hover {
background-color: #2ecc71;
}
.error {
color: #ff0000;
font-size: 18px;
margin-top: 20px;
}
h1 {
color: white;
}
</style>
</head>
<body>
<?php
if(isset($_POST['submit'])) {
$role = $_POST['role'];
if($role == 'student') {
header('Location:student_login.html');
}
elseif($role == 'alumni') {
header('Location: Alumni_Login.html');
}
elseif($role == 'company') {
header('Location: login.php');
}
elseif($role == 'tpco') {
header('Location: TPC.html');
}elseif($role == 'admin') {
header('Location: sysadmin_login.html');
}
else {
$error = "Invalid role selected.";
}
}
?>
<div class="page">
<h1>Welcome to TPC portal</h1>
<div class="form">
<h2>Please select your role to login:</h2>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" class="home">
<select class="select" name="role" id="role">
<option value="">Select your role</option>
<option value="student">Student</option>
<option value="alumni">Alumni</option>
<option value="company">Company</option>
<option value="tpco">TPC Officer</option>
<option value="admin">Admin</option>
</select>
<br>
<input type="submit" name="submit" value="Enter">
</form>
<?php if(isset($error)) { echo "<p class='error'>$error</p>"; } ?>
</div>
</div>
</body>
</html>