#!/usr/bin/env pythonimport cgitbcgitb.enable()import cgi, os, urllibprint "Content-type: text/html"printprint """<HTML><HEAD><TITLE>CGI List Example</TITLE></HEAD><BODY>"""form = cgi.FieldStorage()print "You selected: "selections = form.getlist('data')printable = [cgi.escape(x) for x in selections]print ", ".join(printable)print """<FORM METHOD="GET" ACTION="%s">Select some things:<P>""" % os.environ['SCRIPT_NAME']for item in ['A', 'B', 'C', 'D', 'E', 'F','G']: print '<INPUT TYPE="checkbox" NAME="data" VALUE="%s">' % cgi.escape(item) print ' %s<BR>' % cgi.escape(item)print """<INPUT TYPE="submit" NAME="submit" VALUE="Submit"></FORM></BODY></HTML>"""
Name (required)
email (will not be published) (required)
Website