_REQUEST['var'] and _GET['var']

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lipun4u
Forum Commoner
Posts: 82
Joined: Wed Jul 01, 2009 3:35 am
Location: Mumbai
Contact:

_REQUEST['var'] and _GET['var']

Post by lipun4u »

What is the difference between _REQUEST['var'] and _GET['var'] ???
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: _REQUEST['var'] and _GET['var']

Post by onion2k »

$_REQUEST is an array of all the values from $_GET and $_POST. If you have a $_GET variable and a $_POST variable with the same name you won't know which one is in $_REQUEST (because it can vary from server to server depending on PHP.ini). Always use $_POST and $_GET if you have the option.
lipun4u
Forum Commoner
Posts: 82
Joined: Wed Jul 01, 2009 3:35 am
Location: Mumbai
Contact:

Re: _REQUEST['var'] and _GET['var']

Post by lipun4u »

THANK YOU
Post Reply