Jump to content

$_REQUEST


AV1611

Recommended Posts

Thanks...

Is it depracated? throwback to an old version? or have I just been living under a rock?

[!--quoteo(post=355680:date=Mar 16 2006, 04:30 PM:name=High_-_Tek)--][div class=\'quotetop\']QUOTE(High_-_Tek @ Mar 16 2006, 04:30 PM) [snapback]355680[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Yes
[/quote]
Link to comment
https://forums.phpfreaks.com/topic/5108-_request/#findComment-18125
Share on other sites

You will get the same result from the two functions only if 'email' was POSTed from a form.

If 'email' were part of a querystring then you would need to use $email = $_GET['email'];

If 'email' were a cookie variable then you would need $email = $_COOKIE['email']

In all three cases $_REQUEST['email] will still return the value.


In other words, $_REQUEST returns the value if it is a POST, GET or COOKIE variable.
Link to comment
https://forums.phpfreaks.com/topic/5108-_request/#findComment-18133
Share on other sites

This is the quote from the PHP Online Manual on [a href=\"http://us2.php.net/manual/en/language.variables.predefined.php\" target=\"_blank\"]$_REQUEST[/a]:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]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. [/quote]

Ken
Link to comment
https://forums.phpfreaks.com/topic/5108-_request/#findComment-18144
Share on other sites

I don't know if they were being lazy, I have pages that can posted to or accessed via alink

Up until now i've had to use a If then to work out if they were posted or not. Now that I've just learnt $_REQUEST and what does, (by reading above), I can remove many unneeded lines of code in the future, (I hate revising things that work ;) )
Link to comment
https://forums.phpfreaks.com/topic/5108-_request/#findComment-18896
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.