-
Notifications
You must be signed in to change notification settings - Fork 0
/
score.php
61 lines (57 loc) · 1.47 KB
/
score.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
<?php
session_start();
if (!isset($_SESSION['user_id'])) {
// Redirect to the sign-in page
header("Location: signin.php");
exit();
}
require_once 'models/ENV.php';
require_once 'models/database.php';
require_once 'models/ExceptionWithField.php';
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$tokens = explode('/', $uri);
$uri = $tokens[sizeof($tokens) - 1];
switch ($uri) {
case '':
header('Location: ' . $workingdir . 'signin.php');
exit();
break;
case 'index.php':
header('Location: ' . $workingdir . 'signin.php');
exit();
break;
case 'home.php':
$view = 'home';
require_once './views/layout.php';
break;
case 'profile.php':
$view = 'profile';
require_once './views/layout.php';
break;
case 'score.php':
$view = 'score';
require_once './views/layout.php';
break;
case 'shop.php':
$view = 'shop';
require_once './views/layout.php';
break;
case 'game.php':
$view = 'game';
require_once './views/layout.php';
break;
case 'signin.php':
require_once './views/signin.php';
break;
case 'signup.php':
require_once './views/signup.php';
break;
case 'signout.php':
require_once './views/signout.php';
break;
default:
header('HTTP/1.1 404 Not Found');
echo 'Page not found!';
echo $uri;
exit();
}