PHPを使って2ちゃんねるにHello Worldを書き込むat TECHPHPを使って2ちゃんねるにHello Worldを書き込む - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト18:デフォルトの名無しさん 09/01/21 20:35:12 | \ __ / _ (m) _ピコーン |ミ| / `´ \ ∧ ∧ (・∀ ・) ノ( )ヽ PHPで簡易ブラウザを作ればいいんじゃね? < > Ω ΩΩ <な,なんだってー ∧ ∧ Σ (・∀ ・) <あれ俺今なにか言った? ノ( )ヽ < > 19:sage 09/01/22 10:20:39 Hello world 20:デフォルトの名無しさん 09/01/22 10:53:27 じゃあ俺はPSPをつか(ry 21:デフォルトの名無しさん 09/01/22 11:30:41 Hello world 22:test 09/01/22 11:39:27 Hello world 23:15 09/01/22 11:43:45 <?php $body = "submit=%8F%91%82%AB%8D%9E%82%DE&FROM=%66%75%73%69%61%73%61%6E&mail=sage&MESSAGE=Hello+world&bbs=tech&key=1232331701&time=1"; $length = strlen($body); $head = "POST /test/bbs.cgi HTTP/1.1\r\nHost: pc11.2ch.net\r\nUser-Agent: monazilla/1.00\r\n". "Referer: http://pc11.2ch.net/test/read.cgi/tech/1232331701/l50\r\nContent-Type: application/x-www-form-urlencoded\r\n"; $out = $head."Content-Length: ".$length."\r\n\r\n".$body; $fp = fsockopen("pc11.2ch.net", 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); $cookie .= "NAME=\"\"; MAIL=\"\"; suka=pontan\r\n"; $out = $head.$cookie."Content-Length: ".$length."\r\n\r\n".$body; $fp = fsockopen("pc11.2ch.net", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br>\n";exit; } fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch