Re: $_POST, $_GET and $_REQUEST discarding duplicates [message #170809 is a reply to message #170806] |
Sun, 28 November 2010 16:55 |
|
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.
|
|
|