How do I develop a large whitelist of pages for a PHP include?
<p>It's clear that for any reasonable-sized website, building it in modules using PHP includes has great advantages, so I chose to dynamically create the page content using includes. I was against the idea of including the header and footer, so I did the inverse like this (index.php):</p>

<pre><code>    if(isset($_GET['page']))
    {
        $whitelist = array("contact","about","access", etc.);
        if(in_array($_GET['page'], $whitelist))
        {
           include($_GET['page'].".php");
        }

    }
    else
    {
        include('home.php');
    }
</code></pre>

<p>Some people object to this on security grounds (although they never give an alternative), but I find it to be a neat solution. My question is, what happens when my site has hundreds or even thousands of pages? Do I just keep adding variables to the whitelist array until it becomes huge, or is there a better way?</p>
