- 论坛徽章:
- 0
|
rt
代码如下,不明白原因,麻烦大家指正一下
$httphead = <<<eof
GET /index.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/msword, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; (R1 1.5); .NET CLR 1.1.4322)
Host: aa.aa.com\r\n\r\n
Connection: Keep-Alive \r\n\r\n
eof;
$length = strlen($httphead);
$sock = fsockopen("www.baidu.com",80);
fwrite($sock,$httphead,$length);
while (!feof($sock))
echo fgets($sock); |
|
|