[Tutor] sci heacaches

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 30 Dec 2001 14:02:41 -0800 (PST)


On Sat, 29 Dec 2001, Kirk Bailey wrote:

> ok, I want to pass A SINGLE WORD to a script.
> 
> EVERYTHING after the first '?' in a url is sent to the environment
> variable QUERY_STRING.

Yes, that what the CGI standard says is supposed to happen: the whole
query string be stored in the environmental variable QUERY_STRING.  It
becomes the programmer's job to either pick things out of QUERY_STRING
manually, or use something that other programmers have cooked up, like the
'cgi' module:

    http://python.org/doc/current/lib/module-cgi.html

The 'cgi' module is a little complicated to use at first, but it's worth
using it.  The module does a lot of stuff like automatically escaping and
unescaping special characters in parameters.