In which condition we can use $_REQUEST variable instead of $_GET or $_POST variable. I confused about when use $_request variable because this can be used for both uses of $_get and $_Post variable . So please me help me..
Thank you in advance...
In which condition we can use $_REQUEST variable instead of $_GET or $_POST variable. I confused about when use $_request variable because this can be used for both uses of $_get and $_Post variable . So please me help me..
Thank you in advance...
$_REQUEST, by default, contains the contents of $_GET, $_POST and $_COOKIE.
But it's only a default, which depends on variables_order ; and not sure you want to work with cookies.
I would not use $_REQUEST,I choose $_GET or $_POST depending on application
You should use $_GET when someone is requesting data from your application. And you should use $_POST when someone is pushing (inserting or updating ; or deleting) data to your application.
The short answer is: Always use $_GET
or $_POST
. $_REQUEST
is synonymous with either but detracts from being a diligent, strict coder.
$_REQUEST is not that bad but what if you are getting data from $_COOKIE and hackers send that with $_GET?? your saved value in cookie will be of no value then. SO, always always use $_GET, $_POST, $_COOKIE respectively..