-
Notifications
You must be signed in to change notification settings - Fork 0
/
logout.php
113 lines (105 loc) · 4.54 KB
/
logout.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
error_reporting(E_ALL ^ E_WARNING);
// do login verification here
session_start();
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> Liar's Dice </title>
<link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" type="text/css" href="index.css">
<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="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fascinate+Inline&family=Orbitron&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Kdam+Thmor+Pro&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
<link rel = "icon" href = "img/icon.png" type = "image/x-icon">
<!-- JavaScript Bundle with Popper -->
</head>
<style>
<?php
include "css/main.css";
include "css/index.css";
include "css/logout.css";
?>
</style>
<body class="d-flex flex-column min-vh-100">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.5/dist/umd/popper.min.js" integrity="sha384-Xe+8cL9oJa6tN/veChSP7q+mnSPaj5Bcu9mPX5F5xIGE0DVittaqT5lorf0EI7Vk" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.min.js" integrity="sha384-kjU+l4N0Yf4ZOJErLsIcvOU2qSb74wXpOhqTvwVx3OElZRweTnQ6d31fXEoRD1Jy" crossorigin=" anonymous"></script>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="index.php">{Research Project}</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<span class="move-right">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
</li>
<?php
if($username){
echo "<li class='nav-item'><a class='nav-link'> " . $username . "</a></li>";
echo "<li class='nav-item'>
<a class='nav-link' href='profile.php'> profile </a>
</li>";
echo "<li class='nav-item'>
<a class='nav-link' href='logout.php'> logout </a>
</li>";
}else{
echo "<li class='nav-item'>
<a class='nav-link' href='login.php'> login </a>
</li>";
}
?>
<li class="nav-item">
<a class="nav-link" href="https://github.com/pawanhk/liars-dice-0.0.2">Version Number: 3.0.0 </a>
</li>
</ul>
</span>
</div>
</nav>
<div class="logout">
<form method="POST">
<h2> Are you sure you want to log out ? </h2><br>
<button type="submit" class="btn btn-danger" name="logout">Log out </button><br><br>
</form>
</div>
<?php
if($_SERVER['REQUEST_METHOD'] == "POST"){
if(isset($_POST['logout'])){
unset($_SESSION['username']);
unset($_SESSION['password']);
unset($_SESSION['hasChecked']);
unset($_SESSION['hasCheckedm']);
unset($_SESSION['time1']);
unset($_SESSION['time2']);
unset($_SESSION['time11']);
unset($_SESSION['time22']);
unset($_SESSION['frtime2']);
unset($_SESSION['frtime']);
header("Location: index.php?logout=success");
}
}
ob_end_flush();
?>
<br><br><br><br>
<!-- Footer -->
<footer class="text-center text-lg-start bg-light text-muted mt-auto">
<div class="text-center p-4">
<span class="move-down">
<a class="text-reset fw-bold" href="privacy.php"><span class="footer-elms">Privacy Policy </span> </a>
<a class="text-reset fw-bold" href="contact.php"><span class="footer-elms">Contact </span> </a>
<a class="text-reset fw-bold" href="about.php"><span class="footer-elms">About </span> </a>
<a class="text-reset fw-bold" href="#"><span class="footer-elms">P23Productions </span> </a>
</span>
</div>
</footer>
</body>
</html>