forked from maborosh/BandoriStation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
37 lines (34 loc) · 1.25 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
<?php
require 'config.php';
require ROOT_PATH . '/functions/error_handler.php';
require ROOT_PATH . '/functions/db_select.php';
require ROOT_PATH . '/functions/other_functions.php';
session_start();
if (!isset($_SESSION['login'])) {
auto_login();
}
$query_string = $_SERVER['QUERY_STRING'];
$query_array = explode('/', $query_string);
if ($query_array[0] == '') {
include ROOT_PATH . '/pages/home.php';
} elseif ($query_array[0] == 'login') {
include ROOT_PATH . '/pages/login.php';
} elseif ($query_array[0] == 'login_check') {
include ROOT_PATH . '/pages/login_check.php';
} elseif ($query_array[0] == 'logout') {
session_destroy();
clear_cookie();
header('location: /');
} elseif ($query_array[0] == 'sign_up') {
include ROOT_PATH . '/pages/sign_up.php';
} elseif ($query_array[0] == 'sign_up_check') {
include ROOT_PATH . '/pages/sign_up_check.php';
} elseif ($query_array[0] == 'verify_email') {
include ROOT_PATH . '/pages/verify_email.php';
} elseif ($query_array[0] == 'account') {
include ROOT_PATH . '/pages/account.php';
} elseif ($query_array[0] == 'reset_password') {
include ROOT_PATH . '/pages/reset_password.php';
} else {
include ROOT_PATH . '/pages/error_hint.php';
}