CGI stands for the Common Gateway Interface. It is the next generation of the script interface, called Common because many of the major HTTP servers will be implementing it.For more info about CGI, look here.
The appropriate way to process arguments is to do
http_proc_cgi_args
near the beginning of your Tcl script. http_proc_cgi_args
splits the PATH_INFO and QUERY_STRING shell
environment variables and assigns the values to the global Tcl array
ar. For example, if the script argument assignment foo=bar was passed in, you would access the value bar through $ar(foo). Other CGI specific variables, such as REMOTE_HOST and REMOTE_USER are available through the global Tcl array env.
http_proc_args argv
at the beginning of your script. The call assigns the values to the
global Tcl array ar as in CGI.
var=value1&var=value2 ...If there is only one selection, then only one var=value assignment will be passed to the script. Because of the following reasons:
set artype(var) list
http_proc_cgi_args
or
set artype(var) list
http_proc_args argv
Then, [lindex $ar(var) 0]
will return the right value
when values contain spaces.
The function pkg_attrs
does this. Example usage is:
<A href="/htbin/script-foo[pkg_attrs attributes]">Do script</A>