1
votes

Getting very confused. Searched around but could not find any help that was useful. I get the error

Traceback (most recent call last): File "/Users/Andrew/Desktop/password.py", line 2, in form = cgi.Fieldstorage() AttributeError: 'module' object has no attribute 'Fieldstorage'

import cgi
form = cgi.Fieldstorage()

print """Content-type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head>
<title>Lab 10</title>
</head><body>
"""

password = form.getvalue("password")
if password=="12345":
    print "<p>Password correct.</p>"

else:
    print "<p>Sorry, try again.</p>"

print "</body>"
print "</html>"
1

1 Answers

0
votes

FieldStorage should be spelled with a capital S.