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 #170819 is a reply to message #170809] Mon, 29 November 2010 05:43 Go to previous messageGo to previous message
Jeff North is currently offline  Jeff North
Messages: 58
Registered: November 2010
Karma:
Member
On Sun, 28 Nov 2010 08:55:34 -0800 (PST), in comp.lang.php James
<starritt(at)gmail(dot)com>
<09c3a650-a28b-4a14-8b73-5feeb8e2ed38(at)p7g2000prb(dot)googlegroups(dot)com>
wrote:

> | > >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.

You can always use $_SERVER['QUERY_STRING'] to grab the info (for GET
data anyway). The problem is that you will need to do the parsing of
the string yourself. Not too hard to do. I think the php site even has
code to do this.
[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: Sat Nov 23 01:39:38 GMT 2024

Total time taken to generate the page: 0.03291 seconds