#!/usr/bin/env ruby myname="word-pstore-cgi.rb" require "cgi" c = CGI.new("html4") require "pstore" x = PStore.new("word.db") print "Content-type: text/html; charset=EUC-JP\n\n" print " Word " # 値入力フォームもこのCGIで出力する。 # formのactionをこのCGIプログラムに指定している。 # (mynameはこのスクリプト名) printf("
\n", myname) print '

おなまえ:
ひとこと:

' x.transaction do if x["word"] == nil x["word"] = Hash.new end word = x["word"] if c["name"] > "" && c["word"] > "" name = c["name"] word[name] = c["word"] end print "
\n"
  for person in word.keys
    printf("%sさんのひとこと「%s」\n", person, word[person])
  end
  print "
" end