-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
48 lines (48 loc) · 1.32 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
<!--
name : Sarasa Gunawardhana # IT No : IT14078842
-->
<?php
// If user already logged in, index page redirected to home page
ob_start();
session_start();
if(isset($_SESSION['USERNAME'])){
header("location: ./views/home.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>SSD</title>
<link rel="stylesheet" href="./css/style.css">
</head>
<body>
<!-- form action send to validateClass.php via POST Request -->
<form action="./classes/validateClass.php" method="post">
<!-- image -->
<div class="imgcontainer">
<img src="./images/img_avatar2.png" alt="Avatar" class="avatar">
</div>
<!-- here shows the errors if any unathurised accesses -->
<div class="">
<?php
if(isset($_GET['er'])){
echo '<h1 style="text-align:center;color:red;">'.$_GET['er'].'</h1><br />';
}
?>
</div>
<div class="container">
<!-- username -->
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<!-- Password -->
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<!-- Submit Button -->
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</body>
</html>