Previously i have hash my password with this
$password = hash('sha256' , $salt.$password_arr[$i]);
and in config.php , i have this code to salt the password
$salt = 'jhfdkjdhfTyhdh3365@jdh69kkshhQAAAiyeg';
So my sql database display the hash code when i register a new pass into it, im happy with that, but when i login, it seems it does not recognize my password because the authentication is directly authenticate from the database data. So what can i do to make it work
Here's my code for login verification
<?php
session_start();
include('adminconfig.php');
// username and password sent from form
$username=$_POST['userID'];
$password=$_POST['password'];
// To protect MySQL injection (more detail about MySQL injection)
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$sql="SELECT * FROM admin WHERE ID='$username' and
password='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($result && $count==1){
$_SESSION['userID']= $_POST['userID'];
header('location:adminprofile.php');
}
else {
header('location:adminmessage.php');
die;
}
?>
</body>
</html>