In
$ This-> load-> View ('config ');
$ Dbhost = $ this-> config-> item ("dbhost ");
$ Dbuser = $ this-> config-> item ("dbuser ");
$ Dbpass = $ this-> config-> item ("dbpass ");
$ MSDB = mssql_connect ($ dbhost, $ dbuser, $ dbpass );
Mssql_select_db ("qpaccountsdb", $ MSDB );
$ Account = $ _ post ['user'];
$ Logonpass = MD5 ($ _ post ['Password']);
$ SQL = "select accounts from accountsinfo where accounts = '$ account' and logonpass =' $ logonpass '";
// Echo $ SQL. "<br/> ";
$ Result = mssql_query ($ SQL, $ MSDB );
$ ROW = mssql_fetch_array ($ result, mssql_assoc );
// $ ROW = mssql_fetch_array ($ result, mssql_assoc)
Mysql_free_result ($ result );
Mssql_close ($ MSDB );
// Echo $ row;
If (! Empty ($ row )){
$ Redirect = base_url ('account/message ')."? Status = Success ";
$ Newdata = array (
'Username' => $ this-> encrypt-> encode ($ row ['accounts']),
'Id' => $ this-> encrypt-> encode ($ row ['userid']),
'Logged _ in' => true
);
$ This-> session-> set_userdata ($ newdata );
// Echo $ this-> encrypt-> decode ($ this-> session-> userdata ('username '));
Header ("Location:". $ redirect );
} Else {
$ Redirect = base_url ('customer/login ')."? Status = fail ";
Header ("Location:". $ redirect );
}