Why does the mysql statement in the php code of my little login system look like this?
蹦蹦跳跳的爸爸
蹦蹦跳跳的爸爸 2017-11-02 12:47:47
0
2
836

QQ图片20171102124459.png

蹦蹦跳跳的爸爸
蹦蹦跳跳的爸爸

reply all(2)
。。
别人账号表单中填写 ' or 1=1 /*  密码随便填
那么那条sql就成了where username='' or 1=1
条件成立,登录成功
可以多一步,先取账号, 账号通过后再对比账号
$sql ="select username password from user where username=" .$user;
if($sql && $sql["password"]==$pas){
}


猪哥

You change the sql statement to

 "SELECT username,password FROM user WHERE username=".$user." ADN password =".$psw;

It is recommended to re-learn string splicing and the difference between single quotes and double quotes.

You can search for related tutorials in the search box in the upper right corner of the PHP Chinese website

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template