I want my python script to simultaneously accept POST variables and query string variables from the web address.
The script has code :
form = cgi.FieldStorage()
print form
However, this only captures the post variables and no query variables from the web address. Is there a way to do this?
Thanks,
Ali
cgi.parse_qsl (in any Python
2.*; urlparse.parse_qsl in 2.6 or better) take a query string and return a list ofname, valuepairs. Useos.environ['QUERY_STRING']to get the query string part of the URL your CGI script was reached at (everything after the?in the URL, if any).