#!/usr/bin/pythonimport cgi, sys
#Send errors to browser
sys.stderr = sys.stdout
#Parse data from form
data = cgi.FieldStorage()
#Send response to browser
print "Content-type: text/html\n"
print "<title>CGI Form Response</title>\n"
print "<h2>Current Quote</h2><P>"
if data.has_key('name') and data.has_key('quote'):
print "<B>%s</B>: %s" % (data['name'].value, \
data['quote'].value)
|