PHP & MySQL compare password

前端 未结 5 2127
滥情空心
滥情空心 2020-12-14 05:22

How does one check to see if a user has typed in the right password to log in?

This is what (out of a bunch of combinations...) I am doing:



        
5条回答
  •  萌比男神i
    2020-12-14 06:06

    Get password from user from FORM POST method and convert $_POST['password'] //from form// into appropriate format in php/jsp/any other then compare with formatted password in your database

    Generally md5 encryption is used whene you can compare md45('{$_POST['password']}')= present in your db; or generally mysql use password('your password') command while creating password hence first concert your $_POST['password'] into mysqli_query and mysqli_fetch_array to get encrypted password value and then compare.

提交回复
热议问题