Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. $host = "stackoverflow.com";
  3. $port = 80;
  4. $q = "/";
  5. $v = array(
  6. "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2",
  7. "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
  8. "Accept-Language: en-gb,en;q=0.5",
  9. "Accept-Encoding: gzip, deflate",
  10. "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
  11. "Proxy-Connection: Close",
  12. "Cookie: PREF=ID=2bb051bfbf00e95b:U=c0bb604",
  13. "Cache-Control: max-age=0",
  14. "Connection: Close"
  15. );
  16.  
  17. $ch = curl_init();
  18. curl_setopt($ch, CURLOPT_URL, trim("http://".trim($host).$q));
  19. curl_setopt($ch, CURLOPT_PORT, intval(trim($port)));
  20. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  21. curl_setopt($ch, CURLOPT_ENCODING, "");
  22. curl_setopt($ch, CURLOPT_HTTPHEADER, $v);
  23.  
  24. /* only need verbose report */
  25. curl_setopt($ch, CURLOPT_VERBOSE, true);
  26. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  27. curl_exec($ch);
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement