-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrouter.php
41 lines (39 loc) · 1.1 KB
/
router.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
<?php
// echo __DIR__.'\index.html';
$requests = $_SERVER['REQUEST_URI'];
$cpath = "/groovecomerce";
switch ($requests) {
case $cpath . '/':
header('Location: ' . $cpath . '/public/index.php');
die();
break;
case $cpath . '/public/register':
header('Location: ' . $cpath . '/public/register.html');
die();
break;
case $cpath . '/public/store':
if (isset($_SESSION)) {
header('Location: ' . $cpath . '/public/login.html');
die();
} else {
header('Location: ' . $cpath . '/public/store.php');
die();
}
break;
case $cpath . '/public/login':
header('Location: ' . $cpath . '/public/login.html');
die();
break;
case $cpath . '/logout':
header('Location: ' . $cpath . '/logout.php');
die();
break;
case $cpath . '/public/carrito':
header('Location: ' . $cpath . '/public/carrito.php');
die();
break;
default:
header('Location: ' . $cpath . '/public/index.php');
die();
break;
}