[[.htaccess]]
@DIV
AddHandler cgi-script .rb
@END
[[ruby_01.rb]]
@DIV
#!/usr/local/bin/ruby
print "Content-type: text/html\n\n"
# 標準エラー出力の出力先を標準出力に変更
$stderr = $stdout
print <<LABEL
<style type="text/css">
* {
margin: 0;
}
</style>
LABEL
http://www.ruby-lang.org/ja/man/html/_C1C8A4DFB9FEA4DFB4D8BFF4.html#p(p) ENV
@END
http://land.to/index.php(land.to) は運営会社が変わってから、ページ上部がヘッダー広告
になって見栄えが良くなったので、使いやすいと思います。
http://lightbox.if.land.to/ruby/ruby_01.rb
とにかく、ヒアドキュメントでそれなりの表示を確保しておいて、
[[http://www.ruby-lang.org/ja/man/html/_C1C8A4DFB9FEA4DFB4D8BFF4.html#p(p) ENV]]
これは、PHP で言うところの print_r( $_SERVER ) みたいなものですね。
この結果が文字列で欲しい場合は、
[[変数 = ENV.http://doc.okkez.net/static/186/method/Object/i/inspect.html(inspect)]]
です。
[[http://lightbox.if.land.to/ruby/ruby_01.php(ruby_01.php)]]
@DIV
<style type="text/css">
* {
margin: 0;
}
</style>
<?
print_r($_SERVER);
?>
@END |