How to use password_hash algorithm
镜花水月
镜花水月 2017-09-21 16:22:32
0
1
1129

I have been studying the use of password_hash to process passwords into the database these days but I don’t know how to use it to process passwords entering the database
MD5 can be executed directly on the database statement:

$query = "INSERT INTO  member(urs_name,password,rt_time) VALUES ('{$_POST['urs_name']}',md5('{$_POST['password']}'))";

But password_hash cannot Execute directly on the MYSQL statement like this:

$query = "INSERT INTO  member(urs_name,password,rt_time) VALUES ('{$_POST['urs_name']}',password_hash('{$_POST['password']}')";

Will execute and report an error. How can password_hash be linked with the database?

镜花水月
镜花水月

reply all(1)
Ty80
$query = "INSERT INTO  member(urs_name,password,rt_time) VALUES ('".$_POST['urs_name']."','".password_hash($_POST['password'])."')";


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template