I am writing a code to authenticate with the datas which are in my mysql database.
My script is "almost" ready but i dont know how to successfully use the password.
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$shapass=sha1($password);
$query = mysql_query("select * from alw73_users where password='$shapass' AND username='$username'", $connection);
But not working. Does not authenticate successfully. I think Joomla isnt uses sha1 for password coding or maybe i totally doing it wrong. But what should i use insted of?
The end of the script:
$rows = mysql_num_rows($query);
if ($rows == 1) {
$error = "OK";
echo "OK";
} else {
$error = "NOT OK";
echo "BAD!";
}