祝大家好日子,抱歉提出這樣一個原始問題......但我無法回答! 我們必須輸入字段: 登錄 密碼mysql查詢與安全注射?
,所得到的MySQL
SELECT user.Ident,user.fname,user.lname FROM t_users爲用戶WHERE user.login =:登錄和用戶.pass =:密碼和user.status = 0
我不是黑客,我從來沒有使用mysql注射自己...所以我不能說這是安全的...因爲設置登錄到「'OR 1;#」將不起作用。
EDIT 1
如果我輸入 登錄= 「」 OR 1;#」 口令= '52352352' 我得到這個
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' and user.pass='a32d2f2e60c1757c53cfbc3086d9ecc1' and user.status=0' at line 8
編輯2 問題已關閉,謝謝您的回答!
嘗試,你在查詢中使用它們之前打印變量的值。是「狀態」字符串字段? – manurajhada
是你的密碼在這種情況下加密你選擇應該像'select * from tableName where login ='login'and password = md5('password')' –
@Elmor問題已關閉?不,只有當你接受答案時,即使這樣也可以進一步回答。 – glglgl