Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <?php
  2. $username = $_POST["username"];
  3. $password = $_POST["password"];
  4. $url = 'https://secure.runescape.com/m=weblogin/login.ws';
  5. $fields = array(
  6. 'rem' => 'on',
  7. 'submit' => 'Log In',
  8. 'mod' => 'www',
  9. 'ssl' => '1',
  10. 'expired' => '0',
  11. 'dest' => 'account_settings.ws?jptg=ia&jptv=navbar',
  12. 'username' => $username,
  13. 'password' => $password
  14. );
  15. foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
  16. rtrim($fields_string,'&');
  17. $ch = curl_init();
  18. curl_setopt($ch,CURLOPT_URL,$url);
  19. curl_setopt($ch,CURLOPT_POST,count($fields));
  20. curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
  21. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  22. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  23. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  24. $result = curl_exec($ch);
  25.  
  26. // Do what you want with $result here
  27.  
  28. curl_close($ch);
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement