-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
42 lines (30 loc) · 972 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
<?php
include("resources/php/BookReviews.class.php");
session_start();
if(isset($_SERVER['REQUEST_URI'])){
$req = str_replace(URI,"",$_SERVER['REQUEST_URI']);
$req = explode("?", $req);
$req = $req[0];
$data = explode("/", $req);
array_shift($data);
if(isset($data[1]) && $data[1] == "clear"){
session_unregister('JR');
$sub = $data[0];
array_shift($data);
header("Location: ".URI."/$sub/".implode("/",$data));
exit;
} else {
if(isset($data[0]) && $data[0] == ""){
$data = array();
}
}
}else {
$data = array();
}
//I like not having a persistent session better
if(!isset($_SESSION['JR'])){
$_SESSION['JR'] = new BookReviews();
}
$_SESSION['JR']->hub($data);
//session_write_close();
?>