python cgi problem with textarea

Adrian Smith adrian_p_smith at yahoo.com
Sun Apr 22 02:08:04 EDT 2007


This may be more a cgi thing than a Python one, but I'm trying to get
this page:

http://adrian10.phpwebhosting.com/trial.html

consisting basically of this:

<FORM ACTION="/cgi-bin/python3.cgi" METHOD="POST">
<TEXTAREA NAME="essay" COLS=60 ROWS=20 WRAP=HARD></TEXTAREA>
<P><INPUT TYPE=SUBMIT VALUE="submit" NAME="submitbutton">
</FORM>

...to print out the contents of the textarea with this cgi script:

#!/usr/bin/python
import cgi
print "Content-type: text/html\n"
form = cgi.FieldStorage()
print form["essay"].value

...and I get an internal server error if I have any spaces in the
textarea, which is really going to limit its usefulness to me. Oddly,
it seems to work for a friend in the UK who's looked at it, but it
doesn't work for me here in Japan.




More information about the Python-list mailing list