access form from included cgi
Oleg Broytmann
phd at phd.russ.ru
Wed Apr 5 06:56:55 EDT 2000
Hello!
I have a need to include a CGI in an HTML (Apache):
<!--#include vitrual="/cgi-bin/search.py"--> (for example; and name the
HTML search.html).
I found that I cannot access form data (QUERY_STRING) when I call the
HTML with parameters: http://my.site/search.html?date=21-12-1967.
Deeper investigation showd that QUERY_STRING is always empty, but Apache
passed form data in QUERY_STRING_UNESCAPED.
Found this, I put the following code:
if not os.environ.get("QUERY_STRING", ""):
qs = os.environ.get("QUERY_STRING_UNESCAPED", "") # method == INCLUDED
if qs:
os.environ["QUERY_STRING"] = qs
before form = cgi.FieldStorage().
I think I can put corresponding patch for cgi.py, but I want to discuss
it here before commiting the patch...
Oleg. (All opinions are mine and not of my employer)
----
Oleg Broytmann Foundation for Effective Policies phd at phd.russ.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list
mailing list