Re: downside to passing "[]" characters in URL?
| From: | Monte Ohrt | Date: | Tue, 21 Nov 2000 17:13:55 +0000 |
| Subject: | Re: downside to passing "[]" characters in URL? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26478@lists.php.net to get a copy of this message | ||
eme erre punto MR wrote:
>
> Derek Sivers from CD Baby ...
> >
> > Is there any downside to passing an array value like this, actually using
> > the [] characters?
The only downside I've ran into is trying to manipulate these values
with javascript on the client side, You may run into some problems with
the [] syntax in the URL.
> >
> > <a
> > href="http://something.org?variable[value]=10">link</a>
> >
> > I see the web browser replaces it with "?variable%5Bvalue%5D=10"
> >
> > ... but it seems to work anyway.
> >
> > Can you think of any reason NOT to do this?
> > Is there a better way? Should I serialize it?
>
> (i use PHP 3.0.9)
>
> Well, a thing that i discovered is that PHP doesn't like posted multi-dimensional
> arrays... If you try to post something like
> array[2][6], PHP will do weird things... like as creating $array[2] not as an array, but as a
> standard variable!!!
>
> Believe me, i had to work my way around that problem in order to post two-dimensional arrays to
> a php page...
>
Did you take a look at wddx?