Login5.php Fix or Not check this!

01/18/2017 10:17 maxsalvatore#1
[Only registered and activated users can see links. Click Here To Register...]

im not sure to this... :rtfm:
01/18/2017 21:33 oziel235#2
That's normal. To end this you can add the command error_reporting(0);

about this command:
[Only registered and activated users can see links. Click Here To Register...]


PHP Code:
<?php
error_reporting
(0);
include_once  
'include/dbconn.php'  ;

$id     = ( isset( $_GET['id'] )     ) ? $_GET['id']     : $_POST['id']     ;
$pw     = ( isset( $_GET['passwd'] ) ) ? $_GET['passwd'] : $_POST['passwd'] ;
$ver    = ( isset( $_GET['ver'] )    ) ? $_GET['ver']    : $_POST['ver']    ;
$test   = ( isset( $_GET['test'] )   ) ? $_GET['test']   : $_POST['test']   ;
$code   = ( isset( $_GET['code'] )   ) ? $_GET['code']   : $_POST['code']   ;
$pcode  = ( isset( $_GET['pcode'] )  ) ? $_GET['pcode']  : $_POST['pcode']  ;
$ip     $_SERVER['REMOTE_ADDR']                                           ;
$nation $_GET['nation']                                                   ;



# calling sqlsrv stored procedure
$tsql "{call [dbo].[ROHAN4_Login](?,?,?,?,?,?,?,?,?,?,?,?,?)}";
$user_id    = -1                  ;
$sess_id    str_repeat(' ',36)  ;
$run_ver        str_repeat(' ',20)  ;
$bill_no        = -1                  ;
$grade            = -1                  ;
$ret        = -1                  ;


$tsql_params = array(
  
$id                                   ,
  
md5($pw)                              ,
  
$nation                               ,
  
$ver                                  ,
  
$test                                 ,
  
$ip                                   ,
  
$code                                 ,
  array(&
$user_id ,  SQLSRV_PARAM_OUT ) ,
  array(&
$sess_id ,  SQLSRV_PARAM_OUT ) ,
  array(&
$run_ver ,  SQLSRV_PARAM_OUT ) ,
  array(&
$bill_no ,  SQLSRV_PARAM_OUT ) ,
  array(&
$grade   ,  SQLSRV_PARAM_OUT ) ,
  array(&
$ret     ,  SQLSRV_PARAM_OUT )
);

$res  sqlsrv_query($oConn,$tsql,$tsql_params);
if (
$res === false ){
     die( 
print_rsqlsrv_errors(), true));
}

HttpResponse::setData(  join'|',  array($sess_id,$user_id,$run_ver,$grade,$code) )  );
HttpResponse::send();
?>
01/19/2017 00:16 maxsalvatore#3
Quote:
Originally Posted by oziel235 View Post
That's normal. To end this you can add the command error_reporting(0);

about this command:
[Only registered and activated users can see links. Click Here To Register...]


PHP Code:
<?php
error_reporting
(0);
include_once  
'include/dbconn.php'  ;

$id     = ( isset( $_GET['id'] )     ) ? $_GET['id']     : $_POST['id']     ;
$pw     = ( isset( $_GET['passwd'] ) ) ? $_GET['passwd'] : $_POST['passwd'] ;
$ver    = ( isset( $_GET['ver'] )    ) ? $_GET['ver']    : $_POST['ver']    ;
$test   = ( isset( $_GET['test'] )   ) ? $_GET['test']   : $_POST['test']   ;
$code   = ( isset( $_GET['code'] )   ) ? $_GET['code']   : $_POST['code']   ;
$pcode  = ( isset( $_GET['pcode'] )  ) ? $_GET['pcode']  : $_POST['pcode']  ;
$ip     $_SERVER['REMOTE_ADDR']                                           ;
$nation $_GET['nation']                                                   ;



# calling sqlsrv stored procedure
$tsql "{call [dbo].[ROHAN4_Login](?,?,?,?,?,?,?,?,?,?,?,?,?)}";
$user_id    = -1                  ;
$sess_id    str_repeat(' ',36)  ;
$run_verstr_repeat(' ',20)  ;
$bill_no= -1                  ;
$grade= -1                  ;
$ret        = -1                  ;


$tsql_params = array(
  
$id                                   ,
  
md5($pw)                              ,
  
$nation                               ,
  
$ver                                  ,
  
$test                                 ,
  
$ip                                   ,
  
$code                                 ,
  array(&
$user_id ,  SQLSRV_PARAM_OUT ) ,
  array(&
$sess_id ,  SQLSRV_PARAM_OUT ) ,
  array(&
$run_ver ,  SQLSRV_PARAM_OUT ) ,
  array(&
$bill_no ,  SQLSRV_PARAM_OUT ) ,
  array(&
$grade   ,  SQLSRV_PARAM_OUT ) ,
  array(&
$ret     ,  SQLSRV_PARAM_OUT )
);

$res  sqlsrv_query($oConn,$tsql,$tsql_params);
if (
$res === false ){
     die( 
print_rsqlsrv_errors(), true));
}

HttpResponse::setData(  join'|',  array($sess_id,$user_id,$run_ver,$grade,$code) )  );
HttpResponse::send();
?>
Okey thank u. Finally i fix it. Tnxfor infos.

Sent from my Y511-U00 using Tapatalk

Quote:
Originally Posted by oziel235 View Post
That's normal. To end this you can add the command error_reporting(0);

about this command:
[Only registered and activated users can see links. Click Here To Register...]


PHP Code:
<?php
error_reporting
(0);
include_once  
'include/dbconn.php'  ;

$id     = ( isset( $_GET['id'] )     ) ? $_GET['id']     : $_POST['id']     ;
$pw     = ( isset( $_GET['passwd'] ) ) ? $_GET['passwd'] : $_POST['passwd'] ;
$ver    = ( isset( $_GET['ver'] )    ) ? $_GET['ver']    : $_POST['ver']    ;
$test   = ( isset( $_GET['test'] )   ) ? $_GET['test']   : $_POST['test']   ;
$code   = ( isset( $_GET['code'] )   ) ? $_GET['code']   : $_POST['code']   ;
$pcode  = ( isset( $_GET['pcode'] )  ) ? $_GET['pcode']  : $_POST['pcode']  ;
$ip     $_SERVER['REMOTE_ADDR']                                           ;
$nation $_GET['nation']                                                   ;



# calling sqlsrv stored procedure
$tsql "{call [dbo].[ROHAN4_Login](?,?,?,?,?,?,?,?,?,?,?,?,?)}";
$user_id    = -1                  ;
$sess_id    str_repeat(' ',36)  ;
$run_ver        str_repeat(' ',20)  ;
$bill_no        = -1                  ;
$grade            = -1                  ;
$ret        = -1                  ;


$tsql_params = array(
  
$id                                   ,
  
md5($pw)                              ,
  
$nation                               ,
  
$ver                                  ,
  
$test                                 ,
  
$ip                                   ,
  
$code                                 ,
  array(&
$user_id ,  SQLSRV_PARAM_OUT ) ,
  array(&
$sess_id ,  SQLSRV_PARAM_OUT ) ,
  array(&
$run_ver ,  SQLSRV_PARAM_OUT ) ,
  array(&
$bill_no ,  SQLSRV_PARAM_OUT ) ,
  array(&
$grade   ,  SQLSRV_PARAM_OUT ) ,
  array(&
$ret     ,  SQLSRV_PARAM_OUT )
);

$res  sqlsrv_query($oConn,$tsql,$tsql_params);
if (
$res === false ){
     die( 
print_rsqlsrv_errors(), true));
}

HttpResponse::setData(  join'|',  array($sess_id,$user_id,$run_ver,$grade,$code) )  );
HttpResponse::send();
?>


and the SendCode3.php like this? it is correct

Output on web: -202

Input:
PHP Code:
<?php
include_once  'include/dbconn.php'  ;

$id = ( isset( $_GET['id'] )     ) ? $_GET['id']     : $_POST['id']     ;
$pw = ( isset( $_GET['passwd'] ) ) ? $_GET['passwd'] : $_POST['passwd'] ;
$ip $_SERVER['REMOTE_ADDR']                                  ;


# calling sqlsrv stored procedure
$tsql "{call [dbo].[ROHAN3_SendCode](?,?,?,?)}";
$ret  = -1                                      ;

$tsql_params = array(
  
$id                                   ,
  
md5($pw)                              ,
  
$ip                                   ,
  array(&
$ret     ,  SQLSRV_PARAM_OUT )
);

$res  sqlsrv_query($oConn,$tsql,$tsql_params);
if (
$res === false ){
     die( 
print_rsqlsrv_errors(), true));
}
$ret = -202;
HttpResponse::setData$ret );
HttpResponse::send();
?>