hey there guys the following code is part of a user login form to validate the member... however... it always fails at the if($do == $pass1) stage and the user fails to log in...
function authenticate() {
global $pass, $db_name, $_POST;
$login = $_POST["login1"];
$pass = $_POST["pass"];
$do = crypt($pass,$login);
if(($login != null) && ($pass != null)) {
$auth1 = mysql_query("SELECT member_pass FROM members WHERE member_login = '$login'");
$auth2 = mysql_fetch_array($auth1);
$pass1 = $auth2["member_pass"];
if($do == $pass1) {
$val = $login . '&&' . $pass;
$epxr = time()+3600;
$that = setcookie("biffy", $val, $expr, "/");
if(!$that) {
echo("something buggered up.... hold on a minute...!");
} else {
echo("you are logged in! <BR>$pass1<BR>$do");
}
} else {
echo("Sorry the username and password didn't match, please try again<BR>$pass1<BR>$do");
login_form();
}
} else {
echo("You MUST enter both user name and password!!<BR>");
login_form();
}
}
does anyone have any ideas...?