index get var include
<p>im making a small site</p>

<p>And Instead of having a header.php and a footer.php with neccesarry info (functions,dbconnection, html head) and include on every page I'd like to have it all in index.php. But then I have to add pages to an whitelist and all this. I'd just like to be able to drop it in pages/ and then access it with index.php?page=test</p>

<p>How would I include pages without having to make a big whitelist? How about using preg_match and checcking that page variable only contain a-z. no evil dots. if it only contain letter a-z > include?
or maybe use glob and scan pages/, add them to array so i dont have to edit index.php every time</p>

<p>please tell me your thoughts and ideas</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;SindACC&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;?php include($page) ?&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
