Re: Precedence question- cookie value over form value?
| From: | Rasmus Lerdorf | Date: | Wed, 25 Apr 2001 06:50:29 +0000 |
| Subject: | Re: Precedence question- cookie value over form value? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50238@lists.php.net to get a copy of this message | ||
> If I have a script that checks to see if a variaable is defined. The
> variaable is from a form and is sent to the script. There is also a
> cookie that may be set with a name as the same name as from the form.
> When the script checks and assuming the cookie is set and a value sent
> from the form , which value does the variable take on?
This is determined by your "variables_order" directive in your php.ini
file. By default it is set to "EGPCS" which means that variables are
parsed and inserted into the symbol table in the order:
Environment - GET - POST - Cookie - Server
That is, the later ones override the earlier ones. So in your case the
cookie variable would take precedence. The one from the form (the POST
one) would of course still be available in the $HTTP_POST_VARS array.
-Rasmus