neilmurray
Technical User
I am having a problem getting a password to agree with the encrypted one in mysql. here is my code
$num = mysql_num_rows($result);
if ($num == 1) //login name was found
{
$sql = "select loginName from Member
where loginName='$fusername'
and password=password('$fpassword')";
$result2 = mysql_query($sql)
or die("Couldn't execute query.");
$num2 = mysql_num_rows($result2);
if ($num2 > 0) //password is correct
{
$auth='yes';
$logname=$fusername;
$today = date("Y-m-d h:m:s");
$sql = "insert into Login (loginName,loginTime)
values ('$logname','$today')";
mysql_query($sql) or die("Can't execute query.");
header("Location: about.php");
}
else //password is not correct
{
unset($do);
$message="This is not the correct password, please try
again.<br>";
include("login_form.inc");
}
Its finding the login name but the passwords are not agreeing. I think it is encrypting it wrong
Neil.
$num = mysql_num_rows($result);
if ($num == 1) //login name was found
{
$sql = "select loginName from Member
where loginName='$fusername'
and password=password('$fpassword')";
$result2 = mysql_query($sql)
or die("Couldn't execute query.");
$num2 = mysql_num_rows($result2);
if ($num2 > 0) //password is correct
{
$auth='yes';
$logname=$fusername;
$today = date("Y-m-d h:m:s");
$sql = "insert into Login (loginName,loginTime)
values ('$logname','$today')";
mysql_query($sql) or die("Can't execute query.");
header("Location: about.php");
}
else //password is not correct
{
unset($do);
$message="This is not the correct password, please try
again.<br>";
include("login_form.inc");
}
Its finding the login name but the passwords are not agreeing. I think it is encrypting it wrong
Neil.