beginner python cgi question
email at nowhere.foo
Sat Dec 13 11:08:59 CET 2003
I am trying to learn python, and have a form processing script giving me
Traceback (most recent call last):
File "inquiry", line 16, in ?
File "/usr/local/python2.2/lib/python2.2/cgi.py", line 550, in __getitem__
raise KeyError, key
This is the snippet of code the error is referring to:
if (fields.has_key("name") and fields.has_key("emailaddr")):
I think what the problem is that if my form does not have one of the
fields (except 'name' and 'emailaddr') with data in it, I get this error.
What is the best way to fix this?
Please be kind, this is my first attempt at python. Thanks for the help!
More information about the Python-list