Estoy teniendo un problemita al hacer los cambios de las querys... a ver si alguien me puede dar un manita.
config.php ORIGINAL
Código PHP:
$mssql_host = "localhost";
$mssql_login = "sa";
$mssql_pass = "XXXXXX";
//for 2 pc
$mssql_host2 = "localhost";
$mssql_login2 = "sa";
$mssql_pass2 = "XXXXXX";
$dbaut = "users";
$mssql_dbww = "general";
Código PHP:
DEFINE("SELECT_USER_PASS", "SELECT account, password
FROM user_auth
WHERE account = '%s' ");
Código PHP:
//Auth
$dbconnect = mssql_connect($mssql_host,$mssql_login,$mssql_pass);
mssql_select_db ($dbaut, $dbconnect) or die (mysql_error());
$result = mssql_query (sprintf(SELECT_USER_PASS, $provakk));
if(mssql_num_rows($result)>0 ) {
$rows=mssql_fetch_assoc($result);
extract($rows);
$password = '0x' . bin2hex($password);
$oldpassword = encrypt($provpwd);
if ($password!=$oldpassword) {
$error4in = "<span style='color:red'>Password Incorrecto</span><br>";
} else { $authok = 1;
$_SESSION['acc'] = $provakk;
$_SESSION['pwd'] = $oldpassword;
$_SESSION['menu'] = "onmenu";
}
} else {
$error4in = "<span style='color:red'>Error en captcha.</span><br>";
}
//Auth
Código PHP:
$mssql_host = "MI_IP\MI_INSTANCIA";
$mssql_dbaut = array( "Database"=>"users", "UID"=>"sa", "PWD"=>"XXXXXXXX" );
$mssql_dbgrl = array( "Database"=>"general", "UID"=>"sa", "PWD"=>"XXXXXXXX" );
Código PHP:
//Auth
//Auth
$conn = sqlsrv_connect( $mssql_host, $mssql_dbaut);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
$sql = (sprintf(SELECT_USER_PASS, $provakk));
$stmt = sqlsrv_query( $conn, $sql);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
if(sqlsrv_num_rows($stmt)>0 ) {
$rows=sqlsrv_fetch_array($stmt);
extract($rows);
$password = '0x' . bin2hex($password);
$oldpassword = encrypt($provpwd);
if ($password!=$oldpassword) {
$error4in = "<span style='color:red'>Пароль неверен.</span><br>";
} else { $authok = 1;
$_SESSION['acc'] = $provakk;
$_SESSION['pwd'] = $oldpassword;
$_SESSION['menu'] = "onmenu";
}
} else {
$error4in = "<span style='color:red'>Аккаунт не существует.</span><br>";
}
//Auth