Is there a bug in CGI-POST
Sheila King
usenet at thinkspot.net
Wed Feb 20 18:46:43 EST 2002
On 20 Feb 2002 13:45:54 -0800, sjoshi at ingr.com (Sunit Joshi) wrote in
comp.lang.python in article
<8f8ffe67.0202201345.66fa13ed at posting.google.com>:
> Hello All
> I'm trying use the cgi module and I have seen that if I use the POST
> method in the form then I donot get any form fields. This however
> works with the GET method. Is this known, or am'i doing something
> wrong here. I'm using Xitami Server on Win2000
You are using the FieldStorage from the cgi module, right? Do you have a
statement in your script, near the beginning, like
form = cgi.FieldStorage()
??? (after importing the cgi module, of course...)
If so, then try this.
Somewhere in your script, after the statement:
print "Content-type: text/html\n"
put this:
print "<br><pre>", str(form), "</pre><br>"
Now save it and run it again. Type in some stuff into your form and
click submit.
The contents of the FieldStorage object should be printed to your output
screen. You can see what is stored in the FieldStorage object, and it
should be the data that you typed into the form.
--
Sheila King
http://www.thinkspot.net/sheila/
"When introducing your puppy to an adult cat,
restrain the puppy, not the cat." -- Gwen Bailey,
_The Perfect Puppy: How to Raise a Well-behaved Dog_
More information about the Python-list
mailing list