日记。
作者: we8i
日期: 2012 年 05 月 10 日
没有评论
PHP的POST方式
作者: we8i
日期: 2012 年 04 月 18 日
6 条评论
用来搞刷票,试密码什么的还是不错的
<?php $sock = fsockopen("localhost", 80, $errno, $errstr, 30); if (!$sock) die("$errstr ($errno)\n"); $data = "txt=" . urlencode("中") . "&bar=" . urlencode("Value for Bar"); fwrite($sock, "POST /posttest/response.php HTTP/1.0\r\n"); fwrite($sock, "Host: localhost\r\n"); fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n"); fwrite($sock, "Content-length: " . strlen($data) . "\r\n"); fwrite($sock, "Accept: */*\r\n"); fwrite($sock, "\r\n"); fwrite($sock, "$data\r\n"); fwrite($sock, "\r\n"); $headers = ""; while ($str = trim(fgets($sock, 4096))) $headers .= "$str\n"; echo "\n"; $body = ""; while (!feof($sock)) $body .= fgets($sock, 4096); fclose($sock); echo $body; ?>
《社交网络》观后感
作者: we8i
日期: 2012 年 04 月 04 日
5 条评论


