Guest User

Untitled

a guest
Feb 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?PHP
  2.                 $whitelist = array();
  3.                 $whitelist['news'] = true;
  4.                 $whitelist['progress'] = true;
  5.                 $whitelist['register'] = false;
  6.                
  7.                 function check_inc($arg)
  8.                 {
  9.                     if(isset($whitelist[$arg]) OR $whitelist[$arg] == 1)
  10.                     {
  11.                         if($whitelist[$arg] == true)
  12.                         {
  13.                             return "include";
  14.                         }
  15.                         else
  16.                         {
  17.                             return "deactive";
  18.                         }
  19.                     }
  20.                     else
  21.                     {
  22.                         return "notvalid";
  23.                     }
  24.                 }
  25.                
  26.                 if(isset($_GET['act']))
  27.                 {
  28.                     if(check_inc($_GET['act']) == "include")
  29.                     {
  30.                         include(realpath($_GET['act'].".php"));
  31.                     }
  32.                     elseif(check_inc($_GET['act']) == "deactive")
  33.                     {
  34.                         $_GET['error'] = "deactive";
  35.                         include(realpath('error.php'));
  36.                     }
  37.                     elseif(check_inc($_GET['act']) == "notvalid")
  38.                     {
  39.                         #die($_GET['act'].check_inc($_GET['inc']).$whitelist[$_GET['act']]);
  40.                         $_GET['error'] = "notvalid";
  41.                         include(realpath('error.php'));
  42.                     }
  43.                 }
  44.                 else
  45.                 {
  46.                     include(realpath('news.php'));
  47.                 }
  48.             ?>
Add Comment
Please, Sign In to add comment