Advertisement
Guest User

Untitled

a guest
May 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.80 KB | None | 0 0
  1. <?php
  2. require_once './system/init.php';
  3. require_once './system/customfunctions.php';
  4. $settings = parse_ini_file('./system/settings.ini', true);
  5. $ini = arrayToObject($settings);
  6. /**
  7.  * Retrieve page content file based on GET request.
  8.  *
  9.  * This relies on the .htaccess file for the URL rewrite to properly rewrite
  10.  * the URL.  The rewrite rules look like this:
  11.  * RewriteRule ^about/?$ index.php?page=about
  12.  * RewriteRule ^([a-zA-Z_]+)/?$ /$1.php
  13.  * # If this rule is used in htaccess, leave the "/" off of ^/(..
  14.  * RewriteRule ^/([a-zA-Z_]+)/([\-a-zA-Z0-9_]+)/?$ /$1.php?page=$2
  15.  *
  16.  * The page files in the "include" directory that are called on are responsible for
  17.  * serving the page's content, whether it is formed from database queries or written
  18.  * as static text on a page as in the about page.
  19.  *
  20.  * HEREDOC syntax is used in the static pages to prevent pages from being directly
  21.  * accessed since no content is displayed when called directly except for the 403
  22.  * error.
  23.  *
  24.  * Meta tag "description" can also be defined in the page files, which will be used
  25.  * to override the default page value defined in the settings.ini file.
  26.  */
  27. if(isset($_GET['page']) && !empty($_GET['page']))
  28. {
  29.     require_once './include/' . $_GET['page'] . '.php';
  30. }
  31. else
  32. {
  33.     require_once './include/index.php';
  34. }
  35. ?>
  36. <?php require_once './include/header.php'; ?>
  37. <body>
  38. <div id="wrapper">
  39.     <div id="title">
  40.     <?php echo(isset($titlebar) ? $titlebar:''); // Defined in header.php file. ?>
  41.     </div>
  42.     <div id="menu">
  43.     <?php
  44.         require_once './include/menu.php';
  45.         echo $menu;
  46.     ?>
  47.     </div>
  48.     <div id="main">
  49.     <?php
  50.         if(isset($content)) { echo $content; }
  51.         //if(isset($final)) { echo '<pre>' . $sqlb . '</pre>'; }
  52.     ?>
  53.     </div>
  54. </div>
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement