私的良スレ書庫
不明な単語は2ch用語を / 要望・削除依頼は掲示板へ。不適切な画像報告もこちらへどうぞ。 / 管理情報はtwitterでログインするとレス評価できます。 登録ユーザには一部の画像が表示されますので、問題のある画像や記述を含むレスに「禁」ボタンを押してください。
元スレ【テスト】PHPで2chにHello Worldを書き込む 2
php スレッド一覧へ / php とは? / 携帯版 / dat(gz)で取得 / トップメニューみんなの評価 :
レスフィルター : (試験中)
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:http://" . $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 );
$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:http://" . $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 );
$cookie .= "NAME=\"\"; MAIL=\"\"; yuki=akari; HAP=" . $hap . ";\r\n";
$out = $head . $cookie . "Content-Length: " . $length . "\r\n\r\n" . $body;
$fp = fsockopen( $server, 80, $errno, $errstr, 30 );
if ( !$fp ) {
echo "$errstr ($errno)<br>\n";
exit;
}
$check = "";
fwrite( $fp, $out );
while ( !feof( $fp ) ) {
$check .= fgets( $fp, 128 );
}
fclose( $fp );
if ( mb_strpos( $check, "<title>書きこみました。</title>" ) ) {
echo "書きこみに成功しました。";
exit();
} else {
echo "書きこみに失敗しました。";
}
?>
$out = $head . $cookie . "Content-Length: " . $length . "\r\n\r\n" . $body;
$fp = fsockopen( $server, 80, $errno, $errstr, 30 );
if ( !$fp ) {
echo "$errstr ($errno)<br>\n";
exit;
}
$check = "";
fwrite( $fp, $out );
while ( !feof( $fp ) ) {
$check .= fgets( $fp, 128 );
}
fclose( $fp );
if ( mb_strpos( $check, "<title>書きこみました。</title>" ) ) {
echo "書きこみに成功しました。";
exit();
} else {
echo "書きこみに失敗しました。";
}
?>
Hello World
Part.3
コンマ00クル━━━━(゚∀゚)━━━━??
Part.3
コンマ00クル━━━━(゚∀゚)━━━━??
Hello World
Part.4
今度こそコンマ00クル━━━━(゚∀゚)━━━━??
Part.4
今度こそコンマ00クル━━━━(゚∀゚)━━━━??
おい書き込みどころか確認画面にも辿り着かんぞどういうことだ
500が返ってくるのに408って書いてあるし意味不明
HTTP/1.1 500 Internal Server Error
Date: Sat, 09 Nov 2013 ****** GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8q PHP/5.3.8 mod_antilor
is/0.4
Vary: Accept-Encoding
Content-Length: 675
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>408 Request Time-out</title>
</head><body>
<h1>Request Time-out</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
ch2koha@banana8312.maido3.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8q PHP/5.3.8 mod_antilo
ris/0.4 Server at kohada.2ch.net Port 80</address>
</body></html>
500が返ってくるのに408って書いてあるし意味不明
HTTP/1.1 500 Internal Server Error
Date: Sat, 09 Nov 2013 ****** GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8q PHP/5.3.8 mod_antilor
is/0.4
Vary: Accept-Encoding
Content-Length: 675
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>408 Request Time-out</title>
</head><body>
<h1>Request Time-out</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
ch2koha@banana8312.maido3.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8q PHP/5.3.8 mod_antilo
ris/0.4 Server at kohada.2ch.net Port 80</address>
</body></html>
類似してるかもしれないスレッド
- 【コードギアスレ】Delphi for PHP【RADツール】 (83) - [29%] - 2019/5/9 7:46
- 【PHP】下らねぇ質問はID出して書き込みやがれ 92 (1001) - [26%] - 2010/2/15 17:01 ○
- 【PHP】下らねぇ質問はID出して書き込みやがれ 82 (1001) - [26%] - 2009/4/6 19:33
トップメニューへ / →のくす牧場書庫について