Jump to content

$_REQUEST


AV1611

Recommended Posts

is
[code]
$email=$_REQUEST['email];
[/code]
the same as
[code]
$email=$_POST['email']
[/code]
???

I'm trying to get a php mail form to work that came with a flash... long story...but the php they sent uses $_REQUEST, and I have to adapt it to run on our server
Link to comment
Share on other sites

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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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