如何安全地存储用户的密码?这比平淡有多安全?MD5?我刚开始调查密码安全问题。我对PHP非常陌生。$salt = 'csdnfgksdgojnmfnb';$password = md5($salt.$_POST['password']);$result = mysql_query("SELECT id FROM users
WHERE username = '".mysql_real_escape_string($_POST['username'])."'
AND password = '$password'");if (mysql_num_rows($result) < 1) {
/* Access denied */
echo "The username or password you entered is incorrect.";} else {
$_SESSION['id'] = mysql_result($result, 0, 'id');
#header("Location: ./");
echo "Hello $_SESSION[id]!";}
3 回答
幕布斯6054654
TA贡献1876条经验 获得超7个赞
添加回答
举报
0/150
提交
取消