nobody
nobody

Reputation: 8263

PHP $_REQUEST Variable

I have a question regarding the $_REQUEST global variable in php. When you have a get and a post submitted with the same variable name does php assign priority to either of them? Ie. if I have $_POST['var'] as well as $_GET['var'] submitted to a page would $_REQUEST['var'] contain the post or the get or would it do some other type of assignment?

Thanks!

Upvotes: 7

Views: 5987

Answers (2)

jugnu
jugnu

Reputation: 139

your question is quite similiar to the following post...check it out...

Among $_REQUEST, $_GET and $_POST which one is the fastest?

Upvotes: 0

Pascal MARTIN
Pascal MARTIN

Reputation: 400952

It depends on the request_order configuration directive (quoting) :

This directive describes the order in which PHP registers GET, POST and Cookie variables into the _REQUEST array.


Also take a look at [`variables_order`][2] : some additional explanations *(like the letters that can be used)* are there -- and it also affects `$_REQUEST`.

Upvotes: 8

Related Questions