I am having trouble with my login form, I am trying to make the user login with their email address, password and a passphrase however it is not letting me login, even though I am using correct credentials.
Here is my code
<?php
//set vars
$userM = $_POST['userM'];
$passphrase = $_POST['passphrase'];
$pword = $_POST['pword'];
if ($userM&&$pword&&$passphrase)
{
//connect to db
$connect = mysql_connect("localhost","cl49-XXX","XXX") or die("not connecting");
$query = mysql_query("SELECT * FROM member WHERE email='$userM'");
$numrows = mysql_num_rows($query);
if ($numrows!=0)
{
//while loop
while ($row = mysql_fetch_assoc($query))
{
$email = $row['email'];
$password = $row['password'];
$passphrase = $row['passphrase'];
}
die("incorrect username/password/passphrase!");
}
else
echo "user does not exist!";
}
else
die("please enter a username and password along with passphrase!");
?>
When I fill out the login form with the correct data I am shown user does not exist!
Can anyone help?