#!/usr/bin/ruby

require "cgi"
input = CGI.new

print "Content-type: text/html\n\n";

new = CGI.escapeHTML(input["str"])

if new != "" then
  fp=open("li_list","a")
  fp.puts(new)
  fp.close
end


def foodlist
  fp=open("li_list")
  list=""
  while w = fp.gets
    ww=CGI.escapeHTML(w.chomp)
    list=list+"<li>"+ww+"</li>\n"
  end
  fp.close
  list
end

html=foodlist()


print <<-AA
<html>
<head>
<title>ソープデビュー</title>
</head>
<body>
<h1>ソープ体験について</h1>
<h2>茨城県民のケース(<a href="/junk/soap">更新</a>)</h2>
<p>そういえば :[#{new}]</p>
<hr />
<form  method="post" action="" >
<input type="text" size="80" name="str"/>
<input type="submit" value="push" />
</form>

<ol>
#{html}
</ol>
<hr />
<a href="../">../</a>
</body></html>
 AA

