a7m3dalbalawi

Ysnac Answer

Jun 5th, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. $url = 'https://secure.runescape.com/m=weblogin/login.ws?mod=www&ssl=0&dest=community';
  2. $params = array('username' => $username, 'password' => $password);
  3. $ch = curl_init();
  4. curl_setopt($ch,CURLOPT_URL,$url);
  5. curl_setopt($ch,CURLOPT_POST,count($params));
  6. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  7. 'Content-type: application/x-www-form-urlencoded'
  8. ));
  9. curl_setopt($ch,CURLOPT_POSTFIELDS,$params);
  10. $response = curl_exec($ch);
  11. $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
  12. $header = substr($response, 0, $header_size);
  13. $status = substr($response, $header_size);
  14. echo $status;
Advertisement
Add Comment
Please, Sign In to add comment