Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "stackoverflow.com";
- $port = 80;
- $q = "/";
- $v = array(
- "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2",
- "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
- "Accept-Language: en-gb,en;q=0.5",
- "Accept-Encoding: gzip, deflate",
- "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
- "Proxy-Connection: Close",
- "Cookie: PREF=ID=2bb051bfbf00e95b:U=c0bb604",
- "Cache-Control: max-age=0",
- "Connection: Close"
- );
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, trim("http://".trim($host).$q));
- curl_setopt($ch, CURLOPT_PORT, intval(trim($port)));
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_ENCODING, "");
- curl_setopt($ch, CURLOPT_HTTPHEADER, $v);
- /* only need verbose report */
- curl_setopt($ch, CURLOPT_VERBOSE, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_exec($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement