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