PHP Code:
$username = bin2hex($_POST['username']);
$pass1 = bin2hex($_POST['pass1']);
$pass2 = bin2hex($_POST['pass2']);
$dpass1 = bin2hex($_POST['dpass1']);
$dpass2 = bin2hex($_POST['dpass2']);
$email = bin2hex($_POST['email']);
$gander = bin2hex($_POST['gander']);
$pincode = bin2hex($_POST['pincode']);
// TEST HEX QUERY
$hex_sql = mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account = '".hex($username)."'");
$hex = mssql_fetch_array($hex_sql);
echo $hex['account'];
function hex($h)
{
if (!is_string($h)) return null;
$r='';
for ($a=0; $a<strlen($h); $a+=2) { $r.=chr(hexdec($h{$a}.$h{($a+1)})); }
return $r;
}
is it safe??? or i should use pdo :handsdown::handsdown: