我在网上找到了一篇文章,其中包含以下代码,我想用它来了解更多 php/mysql ......
$username = 'Admin';
$password = 'gf45_gdf#4hg';
$salt = hash('sha256', uniqid(mt_rand(), true) . 'a random string will go here' . strtolower($username));
$hash = $salt . $password;
for ( $i = 0; $i < 100000; $i ++ ) {
$hash = hash('sha256', $hash); }
$hash = $salt . $hash;
当用户想要登录时,我将如何验证 PHP 中的密码?