PHP源码学习:探测httpheader头
类别: PHP教程
<?php /**************************************************** 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.1n"; $header.= "HOST: $hostn"; $header.= "Content-Type: application/x-www-form-urlencodedn"; $header.= "Content-Length: $lengthnn"; $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(); ?> |
- 上一篇: 用户口令检查(/etc/passwd)
- 下一篇: PHP源码学习:站内搜索HTML版
-= 资 源 教 程 =-
文 章 搜 索