php Function for Getting Information from Address Bar and Including a Specified File (Dynamic Pages?)
<p>I'm new to stackoverflow and to php and I'm trying to code this right. What I am trying to do is eliminate the display of pages other than index.php but still include them by utilizing the address bar. For example, I'm trying to write a login script that includes a login.php file but handles all of the form's post information and checks through the index.php file.</p>

<p>I'm trying to create a function to include only specific pages when called upon by the address bar. So the form's action would be to index.php?act=login - I want to $_GET the act (login) and include login.php without the ability for users to include any other files that pose a security risk.</p>

<p>This is my code:</p>

<pre><code>    function getContent() {

    $pages = array('login','page1');

    if(isset($_GET['act']) &amp;&amp; $_GET['act'] == $pages) {
        include($_GET['act'] . '.php');
    } elseif (!isset($_GET['act'])) {
        echo 'INDEX PAGE';
    }
}

getContent();
</code></pre>

<p>Where am I going wrong? I can't get the login.php page to display when index.php?act=login is set. The text "INDEX PAGE" displays just fine with act is not set.</p>
