-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.php
41 lines (36 loc) · 1.37 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
<?php
# Initialize the session
session_start();
# If user is not logged in then redirect him to login page
if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== TRUE) {
echo "<script>" . "window.location.href='./login.php';" . "</script>";
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User login system</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<link rel="stylesheet" href="./css/main.css">
<link rel="shortcut icon" href="./img/favicon-16x16.png" type="image/x-icon">
</head>
<body>
<div class="container">
<div class="alert alert-success my-5">
Welcome ! You are now signed in to your account.
</div>
<!-- User profile -->
<div class="row justify-content-center">
<div class="col-lg-5 text-center">
<img src="./img/blank-avatar.jpg" class="img-fluid rounded" alt="User avatar" width="180">
<h4 class="my-4">Hello, <?= htmlspecialchars($_SESSION["username"]); ?></h4>
<a href="./logout.php" class="btn btn-primary">Log Out</a>
</div>
</div>
</div>
</body>
</html>