Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <?php
  2. $matches = [];
  3. var_dump($_SERVER['REQUEST_URI']);
  4. if ($_SERVER['REQUEST_URI'] ==  '/web/app.php/login') {
  5.     require_once('login.php');
  6. }
  7. else if ($_SERVER['REQUEST_URI'] ==  '/web/app.php/logout') {
  8.     require_once('logout.php');
  9. }
  10. else if ($_SERVER['REQUEST_URI'] ==  '/web/app.php/register') {
  11.     require_once('register.php');
  12. }
  13. else if (preg_match('#^\/web\/app.php\/view\/([0-9]+)$#', $_SERVER['REQUEST_URI'], $matches)){
  14.     $_GET['id'] = $matches[1];
  15.     require_once ('view.php');
  16. }
  17. else if (preg_match('#^\/web\/app.php\/edit\/([0-9]+)$#', $_SERVER['REQUEST_URI'], $matches)){
  18.     $_GET['id'] = $matches[1];
  19.     require_once ('edit.php');
  20. }
  21. else if (preg_match('#^\/web\/app.php\/delete\/([0-9]+)$#', $_SERVER['REQUEST_URI'], $matches)){
  22.     $_GET['id'] = $matches[1];
  23.     require_once ('delete.php');
  24. }
  25. else if (preg_match('#^\/web\/app.php\/404#', $_SERVER['REQUEST_URI'], $matches)){
  26.     require_once ('404.php');
  27. }
  28. else if (preg_match('#^\/web\/app.php\/403#', $_SERVER['REQUEST_URI'], $matches)){
  29.     require_once ('403.php');
  30. }
  31. else if (preg_match('#^\/web\/app.php\/contact#', $_SERVER['REQUEST_URI'], $matches)){
  32.     require_once ('contact.php');
  33. }
  34. else if (preg_match('#^\/web\/app.php\/create-restaurant#', $_SERVER['REQUEST_URI'], $matches)){
  35.     require_once ('create_restaurant.php');
  36. }
  37. else if (preg_match('#^\/web\/app.php\/eval#', $_SERVER['REQUEST_URI'], $matches)){
  38.     require_once ('eval.php');
  39. }
  40. else if (preg_match('#^\/web\/app.php\/view-tickets#', $_SERVER['REQUEST_URI'], $matches)){
  41.     require_once ('view_tickets.php');
  42. }
  43. else if (preg_match('#^\/web\/app.php\/search#', $_SERVER['REQUEST_URI'], $matches)){
  44.     require_once ('search.php');
  45. }
  46. else {
  47.     require_once ('404.php');
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement