Advertisement
taujago

Untitled

Dec 1st, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $url = "http://180.250.16.227/ws_rtmc/index.php/rocknroll";
  5. $method = "SignIn";
  6.    
  7.  
  8.  
  9. $user = "ATWIS";
  10. $pass = "atwis123";
  11. $salt = "1234556678";
  12.  
  13.  
  14. $data =  array("LoginInfo" => array ("LoginName" => $user,
  15.                    "Salt" =>  $salt,
  16.                  "AuthHash" =>  md5( $salt . md5($user.$pass) )   // algo   md5(user+md5(pass))
  17.                 ));
  18.  
  19.  
  20. $json_data = json_encode($data);
  21.     $req_url = $url."/".$method;
  22.     $ch = curl_init();
  23.  
  24.  
  25.     curl_setopt($ch,CURLOPT_URL, $req_url);
  26.  
  27.     curl_setopt($ch,CURLOPT_POST, 1);
  28.     curl_setopt($ch,CURLOPT_POSTFIELDS, $json_data);
  29.     curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  30.  
  31.     $result = curl_exec($ch);
  32.  
  33.  
  34.     curl_close($ch);
  35.  
  36.     echo $result;
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement