-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
50 lines (41 loc) · 889 Bytes
/
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
<?php
session_start();
require('models/database.php');
require('models/model.php');
require('models/post.php');
require('models/functions.php');
if (!isset($_SESSION['loggedin'])) {
$_SESSION['loggedin'] = FALSE;
}
/*
G - games
I - info
F - fanart
C - contact
A - admin
*/
$action = filter_input(INPUT_POST, 'action');
if ($action == NULL) {
$action = filter_input(INPUT_GET, 'action');
$error = filter_input(INPUT_GET, 'error');
}
$runSwitch = substr($action, 0, 1);
switch ($runSwitch) {
case 'G':
include('controlers/games.php');
break;
case 'F':
include('controlers/fanart.php');
break;
case 'I':
include('controlers/info.php');
break;
case 'A':
include('controlers/admin.php');
break;
default:
$posts = displayPosts();
include 'views/home.php';
break;
}
//