When a user types in the correct username and password it should say “your in”.
and when a user types in a correct username and wrong password it should say "incorrect
password". However, even if a user types in a correct username and password it says
“incorrect password” instead of “your in”. I have been trying to solve this for 4 hours I
just don’t know what the problem is. Please help me, it is very frustrating.
[php]<?php
$username = $_POST['username'];
$password = $_POST['password'];
if($username&&$password)
{
$connect = mysql_connect (“Localhost”,“lesultra”,“soulplane”) or die(“couldn’t connect”);
mysql_select_db(“lesultra_members”) or die(“couldn’t find db”);
$query = mysql_query (“SELECT * FROM advertisers WHERE username=’$username’”);
$numrows = mysql_num_rows($query);
if ($numrows!=0)
{
while ($row = mysql_fetch_assoc($query))
{
$dbusername = $row ['username'];
$dbpassword = $row ['password'];
}
if($username==$dbusername&&$password==$dbpassword)
{
echo “YOUR IN!”;
}
else
echo "Incorrect password!";
}
else
die(“That user doesn’t exist”);
}
else
die(“Please enter a valid username and password!”);
?>
[/php]