-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanta-game.php
57 lines (45 loc) · 1.17 KB
/
manta-game.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
<?php
session_start();
?>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" charset="UTF-8">
<link rel="icon" href="/CS12/Images/favicon.ico">
<link rel="stylesheet" href="/CS12/Styles/style.css">
<title>Mantas - Game</title>
</head>
<body>
<?php
$path = $_SERVER['DOCUMENT_ROOT'] . "/CS12/header.php";
include_once($path);
// If session variable is not set it will redirect to login page
if(!isset($_SESSION['username']) || empty($_SESSION['username'])){
?>
<div class="content">
<div class="content-item">
<div id="game" class="center">
<h1>Access Denied</h1>
<p>You must be logged in to access this game.</p>
</div>
</div>
</div>
<?php
} else {
?>
<div class="content">
<div class="content-item">
<div id="game" class="center">
<h1>Manta Mania</h1>
<canvas id="gc" width="600" height="600"></canvas>
<script src="/CS12/Scripts/manta-game.js"></script>
</div>
</div>
</div>
<?php
}
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/CS12/footer.html";
include_once($path);
?>
</body>
</html>