RE: Conversion of http escape characters (Example that uses

Michael McLay (
Tue, 14 Jun 94 12:41:58 EDT

Just in case someone is interested, here's an example that uses It is an enhanced version of the NCSA post-query program. It
simply echos the names/value pairs back to the client. I find it
handy for debugging WWW forms. Make sure the Python sys.path includes
the directory of the CGI scripts for the httpd server.

import os
from www import *

form = FormContent()

keys = form.keys()
print_header('Post test')
print_title('Post Query Test')
print '<B>The following name/value pairs were entered in the form:</B><DL>'
for i in keys:
if form.length(i) > 1:
for j in form.values(i):
print '<DD>',i, '=', j
print ''

print '<DD>',i, '=', form.stripped(i)
# print '<P>'
print '</DL>'

print "<H3>The following operating system environment variables were set by the CGI script:</H3>"

t = os.environ.keys()
print '<DL>'
for key in t:
print "<DD>",key,"=", os.environ[key]
print '</DL>'

print """
<H3>These operating system environment variables could have been set:</H3>