現在我正在開發一個允許在線註冊的應用程序。對於開發,密碼檢查只檢查一個MySQL行,以確保該值與輸入字段中的值匹配。試圖圍繞PHP密碼圍繞鹽/加密
此代碼檢查,看看該行存在:
$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>";
我感到困惑實施鹽業體制改革。我將如何改變這個腳本來檢查加密的密碼?我還沒有找到一個很好的教程,詳細解釋了這一點。
謝謝,這很有道理。 – user978905