I'm trying to learn python but am having problems with this code, it is from a book I bought on python, and the first cgi tutorial I try doesn't work. Basically you submit a form to it and it's supposed to display the information but everytime I try it I get an internal server error, I know Python is working on my server because other scripts run, any help would be greatly appreciated.
I can get HTML to print fine, but when I add in the (who = form['person'].value) lines, nothing works.PHP Code:
reshtml = '''Content-Type: text/html\n
Friends CGI Demo (dynamic screen)
<BODY><H3>Friends list for: <I>%s</I></H3>
Your name is: <B>%s</B><P>
You have <B>%s</B> friends.
form = cgi.FieldStorage()
who = form['person'].value
howmany = form['howmany'].value
print reshtml % (who, who, howmany)