FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » $_POST, $_GET and $_REQUEST discarding duplicates
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: $_POST, $_GET and $_REQUEST discarding duplicates [message #170806 is a reply to message #170803] Sat, 27 November 2010 18:53 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(Luuk)

> On 27-11-10 08:17, Thomas 'PointedEars' Lahn wrote:
>>
>> <… name="verb[]" …>
>>
>> will get you
>>
>> array(1) {
>> ["verb"]=>
>> array(…) {
>> …
>> }
>> }
>>
>> It is a very old "problem", to be found discussed in a great many PHP FAQs.
>> Please do search next time.
>
> Can you point us to these FAQ's?

See questions 3 and 4 on

http://www.php.net/manual/en/faq.html.php

> When i tested, i got the following response:
>
> test.php?a=12&a=12
>
> response:
> array(1) { ["a"]=> string(2) "12" }
>
> so, OP seems to be right that the second parameter gets dropped.

No.

> but when i test with:
> test.php?a=12&a=13
>
> i get:
>
> array(1) { ["a"]=> string(2) "13" }
>
> so, in fact it looks more like the last parameters survives....

Correct, because the second value overrides the first one. If you want
to receive both in your script, make them an array with the syntax
already mentioned.

Micha
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: setup of curl-multi: looping over a bunch of sites [how to adress the array]
Next Topic: ANNOUNCE: NHI1-0.10, PLMK-1.8 und libmsgque-4.8
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 22:32:33 GMT 2024

Total time taken to generate the page: 0.04008 seconds