CGI handler: Retrieving POST and GET at the same time

Samuel knipknap at
Sat Mar 10 19:52:45 CET 2007


I have the following form:

<form action="?one=1" method="post">
<input  type="hidden" name="two" value="2" />

and would like to retrieve both fields, "one" and "two". However, the
following does not work:

form_data = cgi.FieldStorage()
for key in form_data:
    print key + ":", form_data[key].value

It prints out:
two: 2

How can I retrieve the GET variables in that context?


More information about the Python-list mailing list