I found out that g.zExtra doesn't store the query string parameters
but the rest of the path after the page
e.g. http://localhost:8080/doc/tip/www/index.wiki
g.zExtra = tip/www/index.wiki
I had a bit of fun and made th1 fossil env get var command. (actual
looking into fossil cgi_parameters)
and coded in the header
if {[env get name]} {
puts " name=$name "
puts " current_page=$current_page "
} else {
puts " No parameter"
}
in de case of
http://localhost:8080/finfo?name=win/version.c
I got
name=win/version.c current_page=finfo
That did work and would make your idea possible. However my conclusion
is:
I'm sorry to say but you cannot get at the QUERY_STRING or the
individual
parameters of the request in TH1 (server-side processing).
for the curious ( I probably broke 101 rules in coding, not using
subcommand) the routine is
/*
** TH Syntax:
**
** env get VAR
**
** Does do
** set rc 0
** set VALUE [cgi_parameter VAR ]
** if($VALUE){
** set VAR $VALUE
** set rc 1
** }
** return rc
*/
static int env_get_command(
Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
){
int rc =0;
char *value;
if( argc!=3 ){
return Th_WrongNumArgs(interp, "env get var");
}
value = cgi_parameter(argv[2],0); // compiler warning need to include
cgi.h and/or define INTERFACE
if (value){
Th_SetVar(interp, argv[2], argl[2], value, strlen(value)+1);
rc=1;
}
Th_SetResultInt(interp, rc);
return TH_OK;
}
--
Rene
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users