Ok, I've tinkered with this thing for a while, and I keep fixing little
problems, but I always get a 500 Internal Server error when I go to this
site:
I don't necessarily even want help just yet, I'd like to figure it out
myself, but can someone at least tell me why I'm not getting helpful
feedback from the cgitb module? Am I using it wrong? The webpage just
displays the internal server error.
Thanks.
import cryptogen
import cgitb; cgitb.enable()
quote_file = open('quotes.txt')
quote = quote_file.readline().strip()
quote_file.close()
print '''content-type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body><form action="cryptopage.py">'''
quote = cryptogen.convert_quote(quote)
for word in quote[0].split(' '):
word_len = len(word)
print '<input type="text" name="%s" size="%d">' % (word, word_len)
print '<input type="submit" value="Submit"></form></body></html>'