-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
78 lines (70 loc) · 1.82 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
75
76
77
78
<!DOCTYPE html>
<?php
if(session_status() == PHP_SESSION_NONE) {
session_start();
}
if(!isSet($_SESSION["username"])) {
header("location:LoginPage/");
}
?>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Pacman</title>
<link href="LoginPage/style.css" rel="stylesheet" type="text/css">
<style>
.sideArea {
background-color: white;
margin: 3vw;
color: black;
padding: 1vw;
}
iframe#highScore {
float: right;
width: 20vw;
height: 50vh;
background-color: black;
border: none;
}
div#signOut {
float: left;
width: 10vw;
padding: 0;
background-color: black;
}
iframe#game {
width: 50vw;
height: 50vw;
margin: auto;
position: fixed;
right: 25%;
border: none;
}
</style>
<script>
function focusGame() {
document.getElementById("game").focus();
}
</script>
</head>
<body>
<!--High Score area-->
<iframe id="highScore" class="sideArea" src="Database/highscoreScript.php" ></iframe>
<!--Sign Out Area Here-->
<div id="signOut" class="sideArea">
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
unset($_SESSION["id"]);
unset($_SESSION["username"]);
unset($_SESSION["password"]);
echo "<script> parent.window.location.href='LoginPage'; </script>";
}
?>
<form method='post' target='_self'>
<input type='submit' value='Sign Out' />
</form>
</div>
<!--Main Game Iframe here-->
<iframe id="game" src="game/game.php" onload="focusGame();" ></iframe>
</body>
</html>