NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHundamentals Topic #4: php.ini settings

Jeff Barrett jeffb at uniquephoto.com
Thu Nov 13 11:19:50 EST 2003


On a side note:

A good way to get script specific register globals support without having to
modify every program to call some other script is to in your apache config
add a line to your virtual host:
php_admin_value auto_prepend_file /wwwPath/registerGlobals.php

In php.ini turn register_globals off.

The registerGlobals.php script took the view of which scripts are converted
to support register_globals off, added them to an array and if the script
being loaded was not in that array I emulated the action of register globals
manually. Now when I redo an existing script I can make it register globals
safe add it to the array and hopefully one day I will be able to turn it off
in the ini file.

The down side of this is for includes. If you include another script that
requires register_globals on then the calling script must not be in the
array until all the includes are fixed.

> Of course everyone has an opinion about register_globals.
> Since it was defaulted to "off" I've learned to live with it think it's
> the right thing to do.
>
> If you're using third-party warez that need it "on," you could include
> something at the top of each page that defines the EGPCS vars as regular
> global vars. You'd have to put it on every page, but better than fixing
> every reference to a register_globals var instance in the code.
>





More information about the talk mailing list