Re: passing with get?
| From: | Cynic | Date: | Sat, 16 Dec 2000 00:11:50 +0000 |
| Subject: | Re: passing with get? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30615@lists.php.net to get a copy of this message | ||
Agreed. It's even more complicated:
PHP 3:
global variable $foo - always
$HTTP_*_VARS - depending upon track_vars
PHP 4 < 4.0.3
global variable $foo - depending upon register_globals
$HTTP_*_VARS - depending upon track_vars
PHP 4 >= 4.0.3
global variable $foo - depending upon register_globals
$HTTP_*_VARS - always
As someone mentioned before, the actual value of the variable
available in the script depends on gpc_order / variables_order
directive.
To add insult to the injury, behavior of $HTTP_*_VARS arrays
has changed during existence of PHP 4 - from the GET/POST pair,
PHP created only the one coresponding to the request method
used. Now it creates both, irregardless of the request method.
Same can be said about $HTTP_COOKIE_VARS etc, i. e. it's created
even if the client sends no cookie.
IIRC, it even didn't create the $HTTP_GET_VARS array if there
were no GET variables in the request. I believe it behaved the
same with POST.
At 00:41 16.12. 2000, Ignacio Vazquez-Abrams wrote the following:
--------------------------------------------------------------
>On Fri, 15 Dec 2000, jeremy brand wrote:
>
>> http://php.net/?foo=bar
>>
>> $foo is equal to "bar".
>>
>> Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
>> http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
>> for more
>> Get your own Free, Private email at
>> http://www.smackdown.com/
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> At least for the people who send me mail about a new language that
>> they're designing, the general advice is: do it to learn about
>> how to write a compiler. --Dennis Ritchie
>>
>
>Strictly speaking, no. $HTTP_GET_VARS["foo"] is equal to "bar". If
>register_globals is set and variables_order doesn't block it, only then is
>$foo equal to "bar".
>
>Sorry to get pedantic, but a LOT of people trip over that.
>
>--
>Ignacio Vazquez-Abrams <ignacio@openservices.net>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz
ICQ: 2808 2505