简体   繁体   English

验证用户密码与数据库中的密码匹配

[英]Verify User Password Matches Password in Database

I'm not finding what I'm looking for.. so I'm just going to ask. 我没有找到我想要的东西。所以我只想问问。

I have a database in which a program is inputting passwords into the database for users using "password()" I believe. 我有一个数据库,其中有一个程序正在使用我相信的“ password()”向用户输入密码。 I don't care what their password is.. I just want to know how to see if it matches what they're logging in with. 我不在乎他们的密码是什么。.我只想知道如何查看密码是否与他们登录时的密码匹配。

User: testuser

Pass: *73707352065FCC66935AE2E3883E52F483C3CCC8

if(password = dbpassword){}

How can I make that work? 我该如何工作? I've tried: 我试过了:

if(password($_POST['password']) == $result['password']){}

But that doesn't work.. and little variations of that as well. 但这是行不通的,而且几乎没有任何变化。 Can't figure it out. 无法解决。 Please help. 请帮忙。 :) :)

Chances are the passwords are hashed/salted in some way. 密码可能以某种方式被哈希/加盐。

PHP now has built-in password_hash and password_verify functions you should be using, along with simple guides on how to implement. PHP现在具有您应该使用的内置password_hashpassword_verify函数,以及有关如何实现的简单指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM