PHP源码学习:探测httpheader头
程序员文章站
2022-05-25 16:13:34
...
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(); ?> |
上一篇: 555,自己做了一个投票问卷调查功能。
下一篇: 谈谈关于php的优点与缺点_php模板
推荐阅读
-
PHP网页游戏学习之Xnova(ogame)源码解读(七)
-
PHP网页游戏学习之Xnova(ogame)源码解读(九)
-
PHP网页游戏学习之Xnova(ogame)源码解读(四)
-
PHP网页游戏学习之Xnova(ogame)源码解读(五)
-
PHP网页游戏学习之Xnova(ogame)源码解读(十)
-
PHP网页游戏学习之Xnova(ogame)源码解读(二)
-
PHP网页游戏学习之Xnova(ogame)源码解读(十一)
-
PHP网页游戏学习之Xnova(ogame)源码解读(八)
-
PHP网页游戏学习之Xnova(ogame)源码解读(三)
-
PHP网页游戏学习之Xnova(ogame)源码解读(六)