fsockopen 伪造 post和get方法哦,如果你正在找 伪造 post和get方法的php处理代码这款不错哦。
<?php<BR>//fsocket模拟post提交<BR>$purl = "http://localhost/netphp/test2.php?uu=rrrrrrrrrrrr";<BR>print_r(parse_url($url)<div style="color:transparent">!本文来源gaodai.ma#com搞##代!^码网(</div><sup>搞gaodaima代码</sup>);<BR>sock_post($purl,"uu=55555555555555555");<BR>//fsocket模拟get提交<BR>function sock_get($url, $query)<BR>{<BR> $info = parse_url($url);<BR> $fp = fsockopen($info["host"], 80, $errno, $errstr, 3);<BR> $head = "GET ".$info['path']."?".$info["query"]." HTTP/1.0rn";<BR> $head .= "Host: ".$info['host']."rn";<BR> $head .= "rn";<BR> $write = fputs($fp, $head);<BR> while (!feof($fp))<BR> {<BR> $line = fread($fp,4096);<BR> echo $line;<BR> }<BR>}<BR>sock_post($purl,"uu=rrrrrrrrrrrrrrrr");<BR>function sock_post($url, $query)<BR>{<BR> $info = parse_url($url);<BR> $fp = fsockopen($info["host"], 80, $errno, $errstr, 3);<BR> $head = "POST ".$info['path']."?".$info["query"]." HTTP/1.0rn";<BR> $head .= "Host: ".$info['host']."rn";<BR> $head .= "Referer: http://".$info['host'].$info['path']."rn";<BR> $head .= "Content-type: application/x-www-form-urlencodedrn";<BR> $head .= "Content-Length: ".strlen(trim($query))."rn";<BR> $head .= "rn";<BR> $head .= trim($query);<BR> $write = fputs($fp, $head);<BR> while (!feof($fp))<BR> {<BR> $line = fread($fp,4096);<BR> echo $line;<BR> }<BR>}<BR>?><BR>