我试过研究这个,但仍然没有答案.我朋友设计的程序使用MySQL password()函数写入MySQL数据库密码.
我正在寻找一种方法来通过我设计的网络前端使用它,但仍然没有运气.有没有人有什么建议?
密码看起来就像这个例子
mysql> SET old_passwords = 0;
mysql> SELECT PASSWORD('mypass');
+-------------------------------------------+
| PASSWORD('mypass') |
+-------------------------------------------+
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
+-------------------------------------------+
Run Code Online (Sandbox Code Playgroud)
我只需要弄清楚如何将其转换为函数即函数password_hash
这是其余的登录查询示例
if (isset($_POST["username"], $_POST["password"], $_POST[$CONF["LOGIN_SIGNAL_TRIGGER"]])) {
/*
If we got a login signal, a password and a username, we will
proceed to check login information. We will first extract
the user row from the db.
*/
$user = myF(myQ("
SELECT `username`,`password`,`id`,`disable_until`,`active`
FROM `[x]users`
WHERE LCASE(`username`)='".strtolower($_POST["username"])."'
"));
if (!$user["id"]) $GLOBALS["LOGIN_FAIL_TYPE"] = "e.user";
elseif ($user["active"] != 1 && $CONF["LOGIN_REQUIRE_ACTIVE"]) $GLOBALS["LOGIN_FAIL_TYPE"] …Run Code Online (Sandbox Code Playgroud)