Re: &-separator from a form

At 6:22a -0800 01/05/99, Greg Marr wrote:
>At 07:01 PM 1/4/99 , Walter Ian Kaye wrote:
>>Actually it's pretty easy -- my CGI library routine counts the '&'s and ';'s
>>between each name=value pair, and compares the counts to determine the
>>separator.
>
>That's not quite what I meant.  We were discussing:
>name1=value1&name2=value&with&ampersands&in&it&name3=value3
>
>How would your cgi handle that?

Well that's invalid anyway. But I guess you meant

  name1=value1;name2=value&with&ampersands&in⁢name3=value3

which would split to

  value1;name2
  value&with&ampersands&in⁢name3

Hmm... actually it seems my CGI would handle that example properly,
though only by accident. Turns out my code only looks at one item
rather than checking each item. If value2 were where value1 is, then
it would fail. So as long as the first value contains no ampersands,
then it works fine. I could make it smarter, but it's probably not
worth it. ;)

(Sorry folks, didn't expect to get so programmery.)


-Walter

Received on Tuesday, 5 January 1999 12:58:18 UTC