Current Path : /usr/local/share/examples/python2.5/cgi/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/local/share/examples/python2.5/cgi/cgi2.py |
#!/usr/local/bin/python """CGI test 2 - basic use of cgi module.""" import cgitb; cgitb.enable() import cgi def main(): form = cgi.FieldStorage() print "Content-type: text/html" print if not form: print "<h1>No Form Keys</h1>" else: print "<h1>Form Keys</h1>" for key in form.keys(): value = form[key].value print "<p>", cgi.escape(key), ":", cgi.escape(value) if __name__ == "__main__": main()