Jump to content


Photo

$_REQUEST


  • Please log in to reply
6 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 16 March 2006 - 09:14 PM

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

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

#2 High_-_Tek

High_-_Tek
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 16 March 2006 - 09:30 PM

Yes

#3 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 16 March 2006 - 09:34 PM

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) View Post[/div][div class=\'quotemain\'][!--quotec--]
Yes
[/quote]


#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 16 March 2006 - 09:53 PM

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.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 16 March 2006 - 10:22 PM

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

#6 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 19 March 2006 - 03:05 PM

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

#7 Humpty

Humpty
  • Members
  • PipPipPip
  • Advanced Member
  • 132 posts

Posted 19 March 2006 - 09:36 PM

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 ;) )
- Humpty
  #> Where does the light go when it goes out?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users