On Wed, 16 May 2001, Valerio Gionco wrote:
> mod_dtcl must parse QUERY_STRING to find the right variable;
> every time you call [vars get xxx], the module (in the worst case)
> must parse every variable in the string - which is exactly what
> you wanted to avoid.
Actually, libapreq (or something similar :-) parses QUERY_STRING, not
mod_dtcl. But it returns a key-value list.
> I think this approach is effective only if you access
> 'very few' out of 'a lot of' variables. We should consider the case, anyway.
>
> >
> > I also came up with another solution - if QUERY_STRING is 'x=a&x=b&x=c'
> > then $VARS(x) would be either one of them, but ONLY when >1 value exists,
> > then VARSL (or LVARS - sounds better :-) is set. This way you avoid
> > duplicate values.
> >
> > But I'm not sure if it's so easy to check if an entry in apreq is the only
> > entry with such name...
>
> Too complex, I think. The result could be even slower than duplicating values
> (a lot of tests involved, both in mod_dtcl and in the scripts).
I agree.
But since multiple values are a rare case (but may also happen with
cookies and should be considered), it can involve a bit slower methods.
I suppose that one using a list I came up with lately is quite good -
it does not convert the data (except to tcl lists) so the user has
low-level access...
Actually, I'm using mod_dtcl for almost a year and I've never sent
multiple checkboxes with the same name. I'm using NAME=prefix_name
and then array names VARS prefix_*. Didn't benchmark that one, but
shouldn't be that slow...
How does PHP handle 'x=1&x=2'? AFAIR you just send NAME=prefix[] and then
you get an array or list $prefix[value]. But I could be wrong. Same
solution could be done here - NAME=prefix() means it should be set in
another variable or it should be set as a list.
Ok, out of fresh ideas :-(
--
Wojtek Kocjan
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]