簡體   English   中英

如何將輸入的密碼與sql數據庫進行比較?

[英]How to compare the entered password with a sql database?

此代碼應將輸入的密碼與sql數據庫進行比較:

$result = $connection->query($sql);

if($result == false)
    ?><script>alert('Wrong password')</script><?php
while ($result != false) {
    ?><script>alert('Right password')</script><?php
}
$connection->close();

但這確實會檢查輸入的密碼。 但是如何檢查密碼?

測試是否設置了$_POST["username"]$_POST["password"] ,如果沒有設置,則不要執行任何在PHP中進行的檢查。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM