<?php /**************************************************** program : spr2[detect_httpheader] author : uchinaboy e-mail : [email protected] qq : 16863798 date : 2001-7-25 ****************************************************/ $host = "www.infojet.com.cn"; $port = "80"; $path = "/yuhu/"; $filename = "talk0.asp"; $datestream = "sdjahsdjkhaksjd"; $length = strlen($datestream); $header = "post ${ path}$filename http/1.1/n"; $header.= "host: $host/n"; $header.= "content-type: application/x-www-form-urlencoded/n"; $header.= "content-length: $length/n/n"; $header.= "$datestream"; function sock() { global $host, $port, $header; $fsocket = @fsockopen($host, $port, &$errno, &$errstr); if(!$fsocket) { echo "$errstr ($errno)/n"; }else { fputs($fsocket, $header); while(!feof($fsocket)) { $res = fread($fsocket, 128); echo $res; } } fclose($fsocket); } set_time_limit(0); sock(); ?> |
新闻热点
疑难解答