php activate account error
<p>I'm making an activate account page but for some reason it's not working even though I'm almost positive the information I'm entering is accurate. It keeps returning "Your information does not match. Your account has not been activated". What am I missing? An example of the url would be <a href="http://localhost/test4/activate.php?user=Freddy&amp;code=13fe9d84310e77f13a6d184db" rel="nofollow">http://localhost/test4/activate.php?user=Freddy&amp;code=13fe9d84310e77f13a6d184db</a></p>

<pre><code>$message="Enter your email and password to activate your account.";

if ($_POST['activate']){

    $email = $_POST['email'];
    $password = $_POST['password'];
    $user = $_GET['user'];
    $code = $_GET['code'];

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

    if (!$query){
        echo "Couldn't connect to database.";
            exit();
    }

    while ($getrows = mysql_fetch_assoc($query)){
        $dbuser = $getrows['username'];
        $dbpassword = $getrows['password'];
        $dbcode = $getrows['code'];

        if ( ($user == $dbuser) &amp;&amp; ($password == $dbpassword) &amp;&amp; ($code == $dbcode) ){
            $update=mysql_query("UPDATE users SET active='1' WHERE email='$email'");

            if ($update)
                $message="Your account has been activated.";
        }
        else{
            $message="Your information does not match. Your account has not been activated.";
        }       
    }
}
</code></pre>
