View Single Post
Old 31.07.2007, 11:40   #8
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Quote:
Originally Posted by Guaresnay View Post
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; --
FidoW is offline