Jump to content

Archived

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

AV1611

$_REQUEST

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

Share this post


Link to post
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]

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
So, the folks who provided the script were being lazy... right? instead of doing it a set way, then providing an explaination they give a one size fits all...

Share this post


Link to post
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 ;) )

Share this post


Link to post
Share on other sites

×

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.