Created
October 2, 2012 15:00
-
-
Save yyl/3819836 to your computer and use it in GitHub Desktop.
cgi python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Import modules for CGI handling | |
import cgi, cgitb | |
# Create instance of FieldStorage | |
form = cgi.FieldStorage() | |
print "Content-type:text/html\r\n\r\n" | |
print "# of data fields: %s" % len(form) | |
# Get data from fields | |
for key in form.keys(): | |
print "key: %s - value: %s " % (key, form.getvalue(key)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment