#!/usr/bin/env python
import cgitb; cgitb.enable()
import cgi
import os

print 'Content-type: text/html\n'
print "<h1>hello</h1>"
print "<pre>"

print "os.environ['REQUEST_METHOD'] "
print os.environ['REQUEST_METHOD']  

fs = cgi.FieldStorage()

#print type(fs)
print
print fs.__dict__
print


print len(fs.__dict__)
print fs.__dict__.keys()
print

print fs.__dict__["fp"]
print type(fs.__dict__["fp"])

myfile =  fs.__dict__["fp"]

while 1:
		line = myfile.readline()
		if line:
				print line
		else:
				break


print fs

#x = repr(fs)[26:-2]
#print x

print "</pre>"

#outfile = open("users/test.xml", "w")
#outfile.write (x)