Forum Moderators: coopster
from
[php.net...]
Variables provided to the script via the GET, POST, and COOKIE input mechanisms, and which therefore cannot be trusted. The presence and order of variable inclusion in this array is defined according to the PHP variables_order configuration directive.
For example, I have a script which changes the currency for 2checkout on the fly. The script accepts POST or GET (i.e. either from a buy now form, or from an emailed link), and then after changing the currency, forwards the buyer to the checkout page at 2co.
Because I want to accept any type of input with those parameter names, and just pass them on, I use $_REQUEST throughout.
On another related point using $_REQUEST is no different really to having register_globals on...
$_REQUEST or $_POST? [webmasterworld.com]
One more note on $_REQUEST - I use it very ocasionally, and then only for the value(s) which might come in from different methods, and if they're in any way important, I check at the time the form is submitted after being frozen (that it's really $_POST). Maybe paranoid-sounding, but security likes mild paranoia.
This way is also nice keeping your ducks in a row when you have to turn back to your own code and try to figure out what it was doing. The difference between seeing all the $_POST variables and those couple of $_REQUEST variables signals immediately what's up, even if the script isn't well-commented. These little hints about 'what's happening' can be so helpful when you need them.