代码

1
2
3
4
5
6
7
form = cgi.FieldStorage()
if "name" not in form or "addr" not in form:
print "<H1>Error</H1>"
print "Please fill in the name and addr fields."
return
print "<p>name:", form["name"].value
print "<p>addr:", form["addr"].value

参考

  1. https://docs.python.org/2/library/cgi.html

留言