Hi there.
What's difference between $_REQUEST and $_POST ?
And which of them is better to using ?
Thank you.
What's difference between $_REQUEST and $_POST ?
Moderator: General Moderators
Re: What's difference between $_REQUEST and $_POST ?
"The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE.Mds wrote: What's difference between $_REQUEST and $_POST ?
The PHP $_REQUEST variable can be used to get the result from form data sent with both the GET and POST methods."
W3Schools
Re: What's difference between $_REQUEST and $_POST ?
Thank you.
I want to get POST data by my PHP's page.
Is it better to use $_REQUEST or $_POST ?
I want to get POST data by my PHP's page.
Is it better to use $_REQUEST or $_POST ?
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Re: What's difference between $_REQUEST and $_POST ?
it is much better practice to use the specific superglobal instead of $_REQUEST. This way you know for sure were your variables are coming from and you won't have any collisions. Plus it makes it clearer when looking back at old code where you are getting your variables. So, in your case, use $_POST.
Re: What's difference between $_REQUEST and $_POST ?
I agree.shiznatix wrote:it is much better practice to use the specific superglobal instead of $_REQUEST. This way you know for sure were your variables are coming from and you won't have any collisions. Plus it makes it clearer when looking back at old code where you are getting your variables. So, in your case, use $_POST.
Re: What's difference between $_REQUEST and $_POST ?
OK, I got it
Thanks guys.
Thanks guys.