I have a register page that allow user to enter information one of it password so it must be encrypted or hashed so used Bcrypt and it work on the register
but when it come to the login i do not know where and how to use it
can anyone help me?
register.php:
require_once('Bcrypt.php');
$bcrypt = new Bcrypt(15);
$hash = $bcrypt->hash('$pass1');
//********Insert all the members's input to the database**************//
$query = mysql_query("INSERT INTO members
(user_name, first_name, last_name,
governorate, district, village,
birth_date, email_address,
specialization, password, registered_date)
VALUES
('$username', '$firstname', '$lastname',
'$governorate', '$district', '$village',
'$bdate', '$email', '$specialization',
' $hash', now())")
or die("could not insert data");
login.php
require_once('Bcrypt.php');
$bcrypt = new Bcrypt(15);
$hash = $bcrypt->hash('$pass');
$isGood = $bcrypt->verify('$pass', $hash);
$sql=mysql_query("SELECT user_id, email_address,
first_name, user_name
FROM members
WHERE email_address='$email'AND password= '$hash'
LIMIT 1") or die("error in members table");
$login_check = mysql_num_rows($sql);