13/08/28 04:45:16.36
list( , , $server, , , $bbs, $key ) = explode( "/", $url );
$body = "submit=%8F%91%82%AB%8D%9E%82%DE&FROM=" . $name . "&mail=" . $mail . "&MESSAGE=" . $mess . "&bbs=" . $bbs . "&key=" . $key . "&time=1";
$length = strlen( $body );
$head = "POST /test/bbs.cgi HTTP/1.1\r\nHost: " . $server . "\r\nUser-Agent: Monazilla/1.00\r\n" .
"Referer: URLリンク(") . $server . "/test/read.cgi/" . $bbs . "/" . $key . "/l50\r\nContent-Type: application/x-www-form-urlencoded\r\n";
$out = $head . "Content-Length: " . $length . "\r\n\r\n" . $body;
$fp = fsockopen( $server, 80, $errno, $errstr, 30 );
if ( !$fp ) {
echo "$errstr ($errno)<br>\n";
exit;
}
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 );