html5中文学习网

您的位置: 首页 > 网络编程 > PHP编程 » 正文

PHP中伪造HTTP_REFERER代码_PHP教程_编程技术

[ ] 已经帮助:人解决问题
  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.  


mDkHTML5中文学习网 - HTML5先行者学习网
mDkHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助