a secure way to access my pages
<p>I am having trouble trying to figure out how to solve an error in this code. I'm following a video tutorial.</p>

<pre><code>//when your looking for path
$core_path= dirname(__FILE__);
if(empty($_GET['page']) &amp;&amp; in_array("{$_GET['page']}.page.inc.php",scandir("{$core_path}/pages"))==false){
    echo'invalid page';
}
</code></pre>

<p>The error I get when i try testing this code on my wamp server is</p>

<pre><code>Notice: Undefined index: page in C:\wamp\www\pm_system\core\init.inc.php on line 8
</code></pre>
