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 #170809 is a reply to message #170806] Sun, 28 November 2010 16:55 Go to previous messageGo to previous message
James is currently offline  James
Messages: 3
Registered: October 2012
Location: India
Karma:
Junior Member
>> 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

It seems to be inconsistent across versions now testing it. Either
way I have no control over what comes in -- this is a OAI-PMH
repository (http://www.openarchives.org/OAI/openarchivesprotocol.html)
- I have no control over the harvesting services, forms or any HTML -
I don't get into any of that. All I can do is try and make sure that
the input I receive is valid and that I move forwards from there. I
doubt any HTML forms are used anywhere in this process, its either
query strings, or post via applications written in Pearl, C etc etc
and I have no control over poorly written harvesters.


oaipmh.php?verb=Identify (this is entirely valid.)
oaipmh.php?verb=Identify&verb=ListMetadataFormats (Invalid)
oaipmh.php?verb=Identify&verb=Invalid (Invalid)

The latter two seem impossible to catch via $_POST, $_GET and
$_REQUEST ... given that I have no form control.

Just trying to make things perfect here, as this is part of the
validation tests. I am going to pass the query strings our manually,
and interrogate the raw post data I think.


James J.
[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 20:03:37 GMT 2024

Total time taken to generate the page: 0.03240 seconds