problem running the cgi module

chris patton chrispatton at gmail.com
Wed Mar 30 20:45:55 EST 2005


Hi everyone. I'm trying to code an HTML file on my computer to make it
work with the cgi module. For some reason I can't get it running. This
is my HTML script:

------------------------------------------------------

<form method="post" action="C:\chris_on_c\hacking\formprinter.py">
<b><i><font size="50">HOWDY!</font></b></i><br><br>

<input type="text" name="name" size="50" value=""><br><br>

<input type="submit" name="send" value="submit">
</form>

------------------------------------------------------

And here is the python program it's supposed to run with,
formprinter.py:

------------------------------------------------------

import cgi, cgitb
cgitb.enable()

form = cgi.FieldStorage()
print '<font size="12">%s</font><br>' % form['name']

------------------------------------------------------

Whenever I press submit on the HTML document, it returns the code for
"formprinter.py". Can someone tell me what I'm doing wrong?

-Thanks for any help!




More information about the Python-list mailing list