>>478-479をいじってここには書き込めたのに他板には書き込めない、なんで?
<?php
$body = "submit=%8F%91%82%AB%8D%9E%82%DE&FROM=nobody%82%b3%82%f1&mail=sage&MESSAGE=暑い&bbs=php&key=1362790136&time=1";
$length = strlen($body);
$head = "POST /test/bbs.cgi HTTP/1.1\r\nHost: tamae.2ch.net\r\nUser-Agent: Monazilla/1.00\r\n".
"Referer:
http://tamae.2ch.net/test/read.cgi/php/1362790136/l50\r\nContent-Type: application/x-www-form-urlencoded\r\n";
$out = $head."Content-Length: ".$length."\r\n\r\n".$body;
$fp = fsockopen("tamae.2ch.net", 80, $errno, $errstr, 30);
if (!$fp) exit("$errstr ($errno)<br>\n");
fwrite($fp, $out);
$cookie = "Cookie: ";
while (!feof($fp)) {
$str = fgets($fp, 128);
if (strpos($str, "Set-Cookie: ") === 0) {
$str = str_replace("Set-Cookie: ", "", $str);
list($cook, ) = explode(";", $str);
$cookie .= $cook."; ";}}
fclose($fp);
$cookie .= "NAME=\"\"; MAIL=\"\"; yuki=akari; HAP=FOXdayo;\r\n";
$out = $head.$cookie."Content-Length: ".$length."\r\n\r\n".$body;
$fp = fsockopen("tamae.2ch.net", 80, $errno, $errstr, 30);
if (!$fp) exit("$errstr ($errno)<br>\n");
$check = "";
fwrite($fp, $out);
while (!feof($fp)) $check .= fgets( $fp, 128 );
fclose($fp);
if ( mb_strpos( $check, "<title>書きこみました。</title>" ) ) {
header("Location:
http://tamae.2ch.net/test/read.cgi/php/1362790136/l5n";);
} else {exit("書きこみに失敗しました。");}
?>