-
Notifications
You must be signed in to change notification settings - Fork 0
/
maths.php
65 lines (58 loc) · 1.87 KB
/
maths.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
<?php
// Initialize the session
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: login.php");
exit;
}
?>
<!--index.html-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Maths Game</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<link rel="stylesheet" href="styling.css">
</head>
<body>
<div>
<h1>You are logged in as, <b><?php echo htmlspecialchars($_SESSION["username"]); ?></b>.</h1>
</div>
<div id="container">
<div id="score">
Score: <span id="scorevalue">0</span>
</div>
<div id="correct">
Correct
</div>
<div id="wrong">
Try again
</div>
<div id="question">
</div>
<div id="instruction">
Click on the correct answer
</div>
<div id="choices">
<div id="box1" class="box"></div>
<div id="box2" class="box"></div>
<div id="box3" class="box"></div>
<div id="box4" class="box"></div>
</div>
<div id="startreset">
Start Game
</div>
<div id="timeremaining">
Time remaining: <span id="timeremainingvalue">60</span> sec
</div>
<div id="gameOver">
</div>
</div>
<script src="javascript.js"></script>
<p>
<a href="logout.php" class="btn btn-danger">Sign Out of Your Account</a>
</p>
</body>
</html>