Re: Re: $_GET, $_POST, $_COOKIE, $_FILES == $_REQUEST?
| From: | Sterling Hughes | Date: | Wed, 16 Oct 2002 03:43:15 +0000 |
| Subject: | Re: Re: $_GET, $_POST, $_COOKIE, $_FILES == $_REQUEST? | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-89542@lists.php.net to get a copy of this message | ||
On Wed, 2002-10-16 at 05:35, Chris Shiflett wrote:
> Right. I was just wondering if there was a reason why the $_POST array
> wasn't originally created like Sterling suggested for $_FILES and
> $_REQUEST in his solution 1:
>
> $_FILES['toto']['c']['type'] and
> $_REQUEST['toto']['c']['type']
>
> Meaning, I'm not clear why $_FILES is necessary, since the same approach
> can be taken for files in the $_POST array, mixing them with other types
> just like $_REQUEST does (the suggested way above, anyway).
>
> Also, solution 2 mentioned was this:
>
> > $_REQUEST['toto']['c']['type']
> >
> > and
> >
> > $_FILES['toto']['type']['c']
> >
> > which is ugly and just not right, but it maintains backwards
> > compatibility with the $_FILES array.
>
> Is the thought here that no one will be depending on the weird format of
> the $_REQUEST array as mentioned in the bug report? If we're worried
> about BC, I don't see why we should favor one group of people (those
> using $_FILES) over another (those using $_REQUEST), unless I'm missing
> something ...
>
Simply because you really couldn't use $_REQUEST to access the files
array in the past, at least not without risking some dangerous
things/messed up results. The idea is while we can't normalize the
source, we _must_ normalize it when it seeps into other parts of php.
-Sterling
> Chris
>
> Rasmus Lerdorf wrote:
>
> >Because there is more data associated with a file upload than just a
> >single piece.
> >
> >On Tue, 15 Oct 2002, Chris Shiflett wrote:
> >
> >
> >>Out of curiosity, why are files treated differently than all other form
> >>variables submitted via POST?
> >>
> >>We don't have $_TEXT, $_RADIO, etc.
> >>
> >>Maybe there is a good reason, but it seems counter-intuitive to me.
> >>
> >>Chris
> >>