Quote:
Originally Posted by Guaresnay
In that case, ask for old pass, encrypt it, then u check if that password is the same that the password stored using the binary function for SQL..
its like..
PHP Code:
$query = "SELECT account, password FROM user_auth with (nolock) WHERE account = '".$_POST['account']."' AND password = CONVERT(binary, ".encrypt($_POST['oldpass']).")"; $link = mssql_query ($query); if(!mssql_num_rows($link)){ $error = "wrong password"; }
|
SQL injecction possible with that query... be carefull...
Code:
WHERE account = '".$_POST['account']."' AND
' OR 1=1; --