Login his login code is like this: PHPcode $ username $ _ REQUEST [username]; $ password $ _ REQUEST [passw ask about SQL injection
I read this post just now
Http://topic.csdn.net/u/20121011/08/ed0d9538-0ed1-49c4-95c3-0fc1ef686aa2.html
The login code is as follows:
PHP code
$username = $_REQUEST['username'];$password = $_REQUEST['password'];$sql="select * from users where username='$username' and password='$password'";
Later, according to his method, the user name can indeed be submitted without the password to log on successfully.
However, this method first meets the condition that get_magic_quotes_gpc is disabled.
Then his login code seems to be too backward. The current passwords are generally encrypted with md5, for example, my login verification is generally written like this:
PHP code
$ Username = $ _ REQUEST ['username']; $ password = md5 ($ _ REQUEST ['password']); // changed this line $ SQL = "select * from users where username = '$ username' and password =' $ password '";
In this way, the $ SQL statement obtained by submitting the form becomes:
Select * from users where username = 'Sean 'and password = '7e2705cbd698f255b7fe11eff40de898'
How should we inject data like this?
------ Solution --------------------
Isn't there $ username? Why not use $ password?
As long as magic_quotes_gpc = on these pediatric attacks immediately become invalid