之前:对不起我的英语。
好的,现在我正在使用以下加密方法:
SHA256_PassHash(inputtext, "78sdjs86d2h", MyHash, sizeof(MyHash));
带盐的 SHA256:“78sdjs86d2h
现在我正在检查这样的密码:
if(isset($_POST['username']) && isset($_POST['password'])){
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
$check = get_row("SELECT playerID FROM playeraccounts WHERE playerName='$username' && playerPassword='$password'");
if(isset($check['playerID']))
{
$_SESSION['username'] = $_POST['username'];
$_SESSION['password'] = $_POST['password'];
mysql_query("UPDATE playeraccounts SET rpgon=1 WHERE playerName='$username'");
$id = $check['playerID'];
header("location: index.php");
}
else
{
$err = 'Username sau parola incorecte';
}
}
我怎样才能使它与这种盐方法一起工作?请我对 PHP 不是很了解...有人可以启发我如何加密输入文本吗?