Page redirect query
<p>When my user enters their email and password into a form on login.php, the form action uses the below code to make sure they are a valid user, and that neither of the fields are blank. My problem is that even when valid email and password is used the user is directed back to the login.php page instead of the logged_in.php lage, can anyone suggest why?</p>

<pre><code>&lt;?php
        session_start();

        include("connection.inc.php");
        $connection = connect();

        $txtEmail = $_POST['email'];
        $txtPassword = $_POST['password'];

        if ((empty($txtEmail)) || (empty($txtPassword)))
        {
            header("Location: login.php");
            exit;
        }

        $sql = "SELECT * FROM subscriber WHERE email = '$txtEmail' AND password = '$txtPassword'";

        $result = @mysql_query($sql) or die ("Unable to run query");
        $count = mysql_num_rows($result);

        if($count != 0)
        {
            $_SESSION['email'] = $txtEmail;
            $_SESSION['attempt_info'] = "authenticated";
            header("Location: logged_in.php");
        }
        ?&gt;
</code></pre>
