I tried entering the header location as shown below but it does not redirect when the user successfully logs in. I have had success using this function when accessing the member.php page using the URL and it worked perfectly, redirected the user to the log in page.

I would like to know if there is something wrong with the code I have. Please do your part and guide me if ya can :) thank you!

```
<?php

session_start();

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

if ($username&&$password)

{

$connect = mysql_connect("", "", "") or die ("Couldn't connect!");
mysql_select_db("") or die("Couldn't find db");

$query = mysql_query("SELECT * FROM users WHERE username='$username'");

$numrows = mysql_num_rows($query);

}

?>

<link rel="stylesheet" type="text/css" href="stylesheet.css">
<html>

<div class="container">
    <div class="form_wrapper">

        <form action='login.php' method='POST'>
            <?php if ($numrows!=0)
{
    while ($row = mysql_fetch_assoc($query))
    {
        $dbusername = $row ['username'];
        $dbpassword = $row ['password'];
    }
    // check to see if they match!
    if ($username==$dbusername&&$password==$dbpassword)
    {
        $_SESSION['username']=$username;
        header ("Location: member.php");
        exit();
    }
    else
        echo "Incorrect password!";
}
else
    die("User does not exist!");
?>
<br><br>
            <input type='text' name='username' placeholder="Username"><br><br>
            <input type='password' name='password' placeholder="Password"><br><br>
            <input type='submit' value='Log In'>

        </form>

    </div>
</div>

</html>

```