找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 网络编程 PHP 查看内容

PHP源码学习:探测httpheader头

2009-12-21 17:40| 发布者: admin| 查看: 60| 评论: 0|原作者: 云天河

program : Spr2[detect_httpheader]
Author : uchinaboy
E-mail : uchinaboy@163.com
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();
?>


最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 11:40 , Processed in 0.156604 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部