【发布时间】:2011-10-07 04:31:26
【问题描述】:
现在我正在开发一个允许在线注册的应用程序。对于开发,密码检查只检查 MySQL 行以确保值与输入字段中的值匹配。
此代码检查该行是否存在:
$res = mysql_query("SELECT * FROM `users` WHERE `username` = '".$username."' AND `password` = '".$password."'");
$num = mysql_num_rows($res);
//check if there was not a match
if($num == 0){
//if not display error message
echo "<center>The <b>Password</b> you supplied does not match the one for that username!</center>";
我对实施盐系统感到困惑。我将如何更改此脚本以检查加密密码?我还没有找到一个很好的教程来详细解释这一点。
【问题讨论】: