hello all.....
having problems with an encrypted password, i know it is something simple and stupid, but i just cant see it
here is the code that is giving me trouble.....
switch (@$do)
{
case "login":
$connection = mysql_connect($host, $user,$password)
or die ("Couldn't connect to server."
$db = mysql_select_db($database, $connection)
or die ("Couldn't select database."
$sql = "SELECT memberid FROM Member
WHERE memberid='$fusername'";
$result = mysql_query($sql)
or die("Login name not found"
$num = mysql_num_rows($result);
if ($num == 1)
{
$sql = "SELECT memberid FROM Member WHERE memberid='$fusername'
AND password=password('$fpassword')";
$result2 = mysql_query($sql)
or die("Incorrect Password"
$num2 = mysql_num_rows($result2);
if ($num2 > 0)
{
$auth="yes";
$logname=$fusername;
$today = date("Y-m-d h:m:s"
$sql = "INSERT INTO Login (memberid,loginTime)
VALUES ('$logname','$today')";
mysql_query($sql) or die("Can't execute query."
header("Location: Member_page.php"
}
else // password is not correct
{
unset($do);
$message="The Login Name, '$fusername' exists,
but you have not entered the correct
password! Please try again.<br>";
include("login_form.inc"
}
} // 50
elseif ($num == 0).......
it is returning the last message "the loginname, 'soandso' exists, but you have not entered the correct password......"
now i have the correct password in the database, and the ppassword entered into the database was encrypted, but i still get that error. a little help would be awesome
thanks so much
paul
having problems with an encrypted password, i know it is something simple and stupid, but i just cant see it
here is the code that is giving me trouble.....
switch (@$do)
{
case "login":
$connection = mysql_connect($host, $user,$password)
or die ("Couldn't connect to server."
$db = mysql_select_db($database, $connection)
or die ("Couldn't select database."
$sql = "SELECT memberid FROM Member
WHERE memberid='$fusername'";
$result = mysql_query($sql)
or die("Login name not found"
$num = mysql_num_rows($result);
if ($num == 1)
{
$sql = "SELECT memberid FROM Member WHERE memberid='$fusername'
AND password=password('$fpassword')";
$result2 = mysql_query($sql)
or die("Incorrect Password"
$num2 = mysql_num_rows($result2);
if ($num2 > 0)
{
$auth="yes";
$logname=$fusername;
$today = date("Y-m-d h:m:s"
$sql = "INSERT INTO Login (memberid,loginTime)
VALUES ('$logname','$today')";
mysql_query($sql) or die("Can't execute query."
header("Location: Member_page.php"
}
else // password is not correct
{
unset($do);
$message="The Login Name, '$fusername' exists,
but you have not entered the correct
password! Please try again.<br>";
include("login_form.inc"
}
} // 50
elseif ($num == 0).......
it is returning the last message "the loginname, 'soandso' exists, but you have not entered the correct password......"
now i have the correct password in the database, and the ppassword entered into the database was encrypted, but i still get that error. a little help would be awesome
thanks so much
paul