W3C home > Mailing lists > Public > www-html@w3.org > January 1999

Re: &-separator from a form

From: Walter Ian Kaye <walter@natural-innovations.com>
Date: Mon, 4 Jan 1999 16:01:11 -0800
Message-Id: <v03130301b2b703bf30ac@[]>
To: www-html@w3.org
At 7:22a -0800 12/28/98, Greg Marr wrote:

>>If you want to have name=value&thisvalue as a name value pair, the
>>_only_ way to accomplish this is to say name=value%26thisvalue and then
>>decode it in your cgi program.
>or have a CGI that is smart enough to tell the difference, but that's probably
>a much more difficult solution.

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. Unless there are more ';'s than '&'s, the '&' is used.
So, an input like


will easily be recognized as using a ';' separator, since there is
only one separator between the pairs, and it's a semicolon.
(Perl-wise, I split on the '='s, discard the ends of the list, and
then check the contents of the remaining list items.)

Received on Monday, 4 January 1999 19:03:04 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 30 April 2020 16:20:35 UTC