Re: re[PHP] gister_globals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, January 16, 2008 12:21 am, tbt wrote:
> I'm a newbie to php and i would like to set register_globals to 'on'
> from my
> php script itself(eg:- index.php). Is there any way of doing this.

You can't turn it "on" really, because by the time your PHP script is
running and trying to turn it "on", it's too late for the built-in
routines to globalize everything -- They have already opted not to run
because it was "off" (as it should be).

You could use extract($_REQUEST); which amounts the same thing,
however, cramming all the $_REQUEST variables into your PHP script.

THIS IS A BAD IDEA!!!

There is a *REASON* why register_globals got turned OFF!

You should do this ONLY for legacy code that cannot be fixed, and with
a clear path to STOP doing it ASAP.

You also could turn it on in .htaccess for a single directory tree,
which would be more common.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux