Yes, as I stated in my previous post as well, this *definitely* need
to be changed to follow the array name with brackets, otherwise you
are simply redefining that variable over and over again and it will
simply equal the last value. Maybe rails handles this correctly but
probably nothing else will and it simply isn't correct.  I thought we
all knew that to make an array in a query string you use []?

A simple test of the 1.5.1_rc1 code shows that
$H({blah:['foo','bar']}).toQueryString() => "blah=foo&blah=bar"

If you paste this into my test page [1] you will see that php gets:
[blah] => bar

The correct result of the above toQueryString should be:
"blah[]=foo&blah[]=bar"
Which will yield:
[blah] => Array (
  [0] => foo
  [1] => bar
)

Did anyone read my first post to this thread? I make some very good
points there but they seem to have been completely ignored thus far.

[1] http://colin.mollenhour.com/posttest.php

Colin

On Mar 14, 8:06 am, "Richard Quadling" <[EMAIL PROTECTED]>
wrote:
> On 13/03/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote:
>
> > "foo=a&foo=b&foo=c" becomes { foo:['a', 'b', 'c'] }. Rails (PHP too, I
> > think) would preserve only the first value. Ruby preserves all.
>
> In PHP, this would end up as
>
> array(1) { ["foo"]=>  string(1) "c" }
>
> $_GET is an array of 1 element with an index of 'foo' with a value of 'c'.
>
> > "foo[]=a&foo[]=b&foo[]=c" becomes { 'foo[]':['a', 'b', 'c'] }. Rails and PHP
> > would now preserve all values, but remove the square brackets from the key.
>
> In PHP, this would end up as
>
> array(1) { ["foo"]=>  array(3) { [0]=>  string(1) "a" [1]=>  string(1)
> "b" [2]=>  string(1) "c" } }
>
> $_GET is an array of 1 element with an index of 'foo' which is an
> array of 3 elements, 'a', 'b' and 'c'.
>
> If you have PHP, use this as showget.php
>
> <?php var_dump($_GET); ?>
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to