why isn't my error message working?
<p>I've got a simple form for a <code>$_Session</code> and it's not printing my error message when the password is wrong. It works fine other than the error message and in fact the error message worked until I put <code>header("Location: /cms/");</code> in. Is there something I'm doing wrong?</p>

<pre><code>&lt;?php 
session_start();
$error_msg = "";

if($_POST['username']) {

$username = $_POST['username'];
$password = $_POST['password'];

$admin = "a";
$adminpass = "s";

if(($username != $admin) || ($password != $adminpass)) {
$error_msg = 'Your login information is wrong dude!';
} 
else {
    $_SESSION['admin'] = '$username';
        header("Location: /cms/");
    exit();
}

}
if(!isset($_SESSION['admin'])) {
    header("Location: /cms/login");     
exit();
}
?&gt;

&lt;html&gt;
&lt;body&gt;

&lt;form action="/cms/loggedin.php" method="post" target=_self&gt; 
&lt;label&gt;Username: &lt;input type="text" name="username" id="username"&gt;&lt;/label&gt;
&lt;font color="#FF0000"&gt;&lt;?php echo $error_msg; ?&gt;&lt;/font&gt;&lt;br /&gt;

&lt;br /&gt;
&lt;label&gt;Password: &lt;input type="text" name="password" id="password"&gt;&lt;/label&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;label&gt;&lt;input type="submit" name="Submit" value="Sign In"&gt;&lt;/label&gt;
&lt;/form&gt;
</code></pre>

<p>
</p>
