Simple login PHP script refreshing the page
<p>I have a simple PHP login script that directs the user to dashboard.php if the login is successful. Currently, all it is doing is refreshing the page.</p>

<pre><code>    &lt;?php 
if (isset($_POST["submit"])) {
    // startar sesion
    session_start(); 

// username and password
$userName = "user";
$password = "pass";
}

if (isset($_POST["userName"]) &amp;&amp; isset($_POST["password"])) { 

    if ($_POST["userName"] == $userName &amp;&amp; $_POST["password"] == $password) { 

    header( 'Location: dashboard.php' ) ; 
    } 
        // wrong login - message
        else {echo 'foo';} 
    }
    ?&gt;
</code></pre>
