Advertisement
Guest User

Untitled

a guest
Nov 27th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2.  
  3. $curl_handle=curl_init();
  4.  
  5. $username = "";
  6. $password = "";
  7.  
  8. $fullurl = "http://www.queensberry.com";
  9. $ch = curl_init();
  10. curl_setopt($ch, CURLOPT_HEADER, 1);
  11. curl_setopt($ch, CURLOPT_VERBOSE, 1);
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  14. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  15. curl_setopt($ch, CURLOPT_FAILONERROR, 0);
  16. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  17. curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
  18. curl_setopt($ch, CURLOPT_URL, $fullurl);
  19.  
  20. $returned = curl_exec($ch);
  21.  
  22. curl_close ($ch);
  23. var_dump($returned);
  24.  
  25.  
  26. ?>
  27.  
  28. $ch = curl_init();
  29. curl_setopt($ch, CURLOPT_HEADER, 0);
  30. curl_setopt($ch, CURLOPT_VERBOSE, 1);
  31. //curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  32. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  33. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  34. curl_setopt($ch, CURLOPT_FAILONERROR, 0);
  35. // curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  36. curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
  37. curl_setopt($ch, CURLOPT_URL, $fullurl);
  38.  
  39. $returned = curl_exec($ch);
  40.  
  41. curl_close ($ch);
  42. var_dump($returned);
  43.  
  44. $data = curl_exec($ch);
  45. $start = strpos($data, "rnrn") + 4;
  46. $body = substr($data, $start, strlen($data) - $start);
  47.  
  48. $info = curl_getinfo($ch);
  49. $start = $info['header_size'];
  50. $body = substr($result, $start, strlen($result) - $start);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement