i seem to have a problem...it is that after registering the user and
creating an account for him in the database,when i try to login with
the created account....i am not able 2...it keeps flashing PASSWORD
INCORRECT......odd thing is it was working sometime ago.....so there
must be some minor error which i am not able to detect.....this is the
code if someone can please help asap......
if($numrows !=0)
{//code to login
while($pass=mysql_fetch_assoc($query));//the while loop is for
the case that username matches and password doesn't
{
$dbusername=$pass['username'];
$dbpassword=$pass['password'];
}
echo $dbpassword;
$password=md5($password);echo $password;//encrypting the password
I SUSPECT THAT THE PROBLEM IS IN THIS LINE--->if($username==
$dbusername && $password==$dbpassword)//to check if the database
username matches to that provided
{
echo "You're in<br><a href='account.php'>Visit my Account</a>";
$_SESSION['username']=$dbusername;
}
else
echo "Password is incorrect";
}
else
die("That user doesnt exist");
i wud be grateful if someone can help!!
Saagar