Dump.cgi: Difference between revisions
(New page: <source lang="python"> #!/usr/bin/python import cgi fs = cgi.FieldStorage() print "Content-type: text/html" print print "<h1>dump</h1>" keys = fs.keys() keys.sort() print "<dl>" for ...) |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Note that the use of ''str'' since the return value of ''getvalue'' is can be a String, None, or in the case of a multiple value (for instance with checkboxes), a List. | |||
See the documentation page for the [http://docs.python.org/library/cgi.html cgi] module for all the details. | |||
<source lang="python"> | <source lang="python"> | ||
#!/usr/bin/python | #!/usr/bin/python |
Latest revision as of 17:02, 19 January 2009
Note that the use of str since the return value of getvalue is can be a String, None, or in the case of a multiple value (for instance with checkboxes), a List.
See the documentation page for the cgi module for all the details.
#!/usr/bin/python
import cgi
fs = cgi.FieldStorage()
print "Content-type: text/html"
print
print "<h1>dump</h1>"
keys = fs.keys()
keys.sort()
print "<dl>"
for i in keys:
print "<dt>" + i + "</dt>"
print "<dd>" + str(fs.getvalue(i)) + "</dd>"
print "</dl>"