#! /usr/bin/python # Show variables passed via CGI import cgi, cgitb cgitb.enable() def Main(): form=cgi.FieldStorage() the_keys=form.keys() the_keys.sort() html='' for akey in the_keys: avalue=form.getvalue(akey,'') html+=akey+'='+str(avalue)+'
\n' print 'Content-type: text/html\n' print 'Variables and values sent:

\n' print html print '' Main()