日期:2012-03-28  浏览次数:20403 次

  1. error_reporting( E_ERROR  E_WARNING  E_PARSE );  
  2. set_time_limit(0); 
  3.  
  4. $server  = 'www.php100.com';   // IP address  
  5. $host    = 'www.php100.com';   // Domain name  
  6. $target  = '/test.php?x=1';    // Specific program  
  7. $referer = 'http://www.php100.net/down/redirect.php?x=downurl&id=39&urlid=65';    // Referer  
  8. $port    = 80
  9.  
  10. $re = fsockopen($server, $port, $errno, $errstr, 30);  
  11. if (!$re){  
  12.    echo "<h1>无法连接远程服务器</h1><h3>$errstr ($errno)</h3/>\n";  
  13. }   
  14. else {  
  15.  $strhead = "GET $target HTTP/1.1\r\n";  
  16.  $strhead ."Host: $host\r\n";  
  17.  //$strhead ."Cookie: PHPSESSIONIDSQTBQSDA=DFCAPKLBBFICDAFMHNKIGKEG\r\n";  
  18.  $strhead ."Referer: $referer\r\n";  
  19.  $strhead ."Connection: Close\r\n\r\n";
  20.  
  21.  fwrite($re, $strhead);  
  22.  while (!feof($re)){  
  23.   echo fgets($re, 128);  
  24.  }  
  25.  fclose($re);  
  26. }  
  27.