Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $matches = [];
- var_dump($_SERVER['REQUEST_URI']);
- if ($_SERVER['REQUEST_URI'] == '/web/app.php/login') {
- require_once('login.php');
- }
- else if ($_SERVER['REQUEST_URI'] == '/web/app.php/logout') {
- require_once('logout.php');
- }
- else if ($_SERVER['REQUEST_URI'] == '/web/app.php/register') {
- require_once('register.php');
- }
- else if (preg_match('#^\/web\/app.php\/view\/([0-9]+)$#', $_SERVER['REQUEST_URI'], $matches)){
- $_GET['id'] = $matches[1];
- require_once ('view.php');
- }
- else if (preg_match('#^\/web\/app.php\/edit\/([0-9]+)$#', $_SERVER['REQUEST_URI'], $matches)){
- $_GET['id'] = $matches[1];
- require_once ('edit.php');
- }
- else if (preg_match('#^\/web\/app.php\/delete\/([0-9]+)$#', $_SERVER['REQUEST_URI'], $matches)){
- $_GET['id'] = $matches[1];
- require_once ('delete.php');
- }
- else if (preg_match('#^\/web\/app.php\/404#', $_SERVER['REQUEST_URI'], $matches)){
- require_once ('404.php');
- }
- else if (preg_match('#^\/web\/app.php\/403#', $_SERVER['REQUEST_URI'], $matches)){
- require_once ('403.php');
- }
- else if (preg_match('#^\/web\/app.php\/contact#', $_SERVER['REQUEST_URI'], $matches)){
- require_once ('contact.php');
- }
- else if (preg_match('#^\/web\/app.php\/create-restaurant#', $_SERVER['REQUEST_URI'], $matches)){
- require_once ('create_restaurant.php');
- }
- else if (preg_match('#^\/web\/app.php\/eval#', $_SERVER['REQUEST_URI'], $matches)){
- require_once ('eval.php');
- }
- else if (preg_match('#^\/web\/app.php\/view-tickets#', $_SERVER['REQUEST_URI'], $matches)){
- require_once ('view_tickets.php');
- }
- else if (preg_match('#^\/web\/app.php\/search#', $_SERVER['REQUEST_URI'], $matches)){
- require_once ('search.php');
- }
- else {
- require_once ('404.php');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement