title: Multiple page includes dynamic url PHP
body: <p>I'm trying to have a multiple page include. For example:</p>
  <p><a href="http://www.website.com/?page=brewery&amp;name=heineken&amp;section=manage&amp;subsection=beesr&amp;action=create" rel="nofollow noreferrer">www.website.com/?page=brewery&amp;name=heineken&amp;section=manage&amp;subsection=beesr&amp;action=create</a></p>
  <p>Basically, there will be a brewery page for said brewery, and a manage page for admins. If user is admin, they can view manage page &gt; view beers &gt; create beer.</p>
  <p>I've tried doing a page include script below on each page (brewery, manage, beer), but it gives me a fatal error.</p>
  <p>Is there anyway to merge 5 parameters into one file, say brewery?</p>
  <p>Below is example code:</p>
  <pre><code>    // Allowed pages
      $pages = array(
      'main',
      'range',
      'manage'
      );
  
      // Check if page is empty
      if (!isset($_GET['section'])) {
          include('pages/brewery/main.php');
      } else {
      
          // Check file format
          if (strpos($_GET['section'], '.') !== false) {
              header('HTTP/1.0 404 Not Found');
              include('pages/brewery/main.php');
          } else {
          
              // Check if file exists
              if (!file_exists(sprintf('pages/brewery/%s.php', $_GET['section']))) {
                  header('HTTP/1.0 404 Not Found');
                  include('pages/brewery/main.php');
              } else {
              
                  // If page is allowed - incude
                  if (in_array($_GET['section'], $pages)) {
                      include('pages/brewery/' . $_GET['section'] . '.php');
  
                  
                      // Check if the page is not allowed
                      } else {
                      header('HTTP/1.0 404 Not Found');
                      include('pages/brewery/main.php');
              
              } // Close check if the page is not allowed
          } // Close check of file exists
      } // Close check file format
  } // Close check if page is empty
  ?&gt;``` 
  </code></pre>