So I've just been innocently using $_POST and $_GET when I needed to. POST for forms, GET for URLs. Peachy.
So then all of a sudden, one of my scripts doesn't work. ONLY ONE, though. And I used a $_GET in it. This is the only script that does this.
I change it to REQUEST, bang. Works perfectly.
So I go to look it up in W3, and I get this:
"The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE.
The PHP $_REQUEST variable can be used to get the result from form data sent with both the GET and POST methods."
But what's odd is, there's no down sides. I look at the PHP manual, can't find a down side. (it was also a tad opaque)
So my question - are there any down sides, or should I change every post and get I have, to request?
Edit: Thanks, guys.
$_REQUEST
Moderator: General Moderators
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
$_REQUEST
Last edited by Mightywayne on Wed Aug 08, 2007 4:19 pm, edited 1 time in total.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: $_REQUEST
Using $_REQUEST gives you a similar effect as using register_globals, though not AS unpredictable. The overlapping may easily cause difficulty, especially since you are using it for get requests and they have the lowest precedence by default (GPCS).