#!/usr/bin/env ruby
require 'cgi'

c = CGI.new
name = c["onamae"]

print "Content-type: text/html; charset=utf-8\n\n"	# お約束

print(<<EOF)
<!DOCTYPE html>
<head lang="ja">
<title>Hello!!!</title>

<form method="POST" action="hello.rb">
 <p>あなたの名前: <input type="text" name="onamae"></p>
 <p><input type="submit" value="送信">
 <input type="reset" value="reset"></p>
</form>
<h2>こんにちは#{name}さん!!</h2>
</body> 
EOF
