The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

yep, i know, but, its an old fashioned script, that i need to integrate, and it is using "session_register", and its the requirement of that script to turn on register_globals, if i change the settings in php.ini it works fine, so, thats why i need register_globals to be turned on!

In fact, i am not able to change any of the php.ini settings for that particular folder or application, suppose i need to change some setting for a particluar application, then, is there a way to do this?

currently, i've tried to put in a file "php.ini" with my settings, but, if i am checking those settings by creating a file phpinfo.php and executing that file, i still see default php.ini settings.

Just remember that PHP6 doesn't even have the ability to turn register_globals on since it was deprecated in PHP 4.2 and made completely obsolete in PHP 5. You only need to add about three lines of code to the top of a script to copy all the $_REQUEST values to their equivalent variable names so as to give the equivalent of turning on register_globals anyway without actually doing so.

Fiddle with a few other settings in .htaccess . If the changes still fail to show up within PHP, it's likely that .htaccess is disabled. In order to enable .htaccess, you must set AllowOverride directive inside httpd.conf to all.

No. php_admin_flag cannot go in .htaccess, only httpd.conf (or any Apache configuration file to be specific). It’s used specifically so that a setting cannot be modified from .htaccess. But you gave me a great hint! If in httpd.confregister_globals is set with:

Code:

php_admin_flag register_globals off

rather than:

Code:

php_flag register_globals off

Then you can’t change it from .htaccess. This may be the reason why it’s not working. Do you have access to Apache configuration?

Why not just fix the script so that it doesn't require register globals in order to run. After all that option was turned off by default and deprecated in PHP 4.2 and declared completely obsolete in PHP 5 and has already been completely removed from PHP 6. So for any scripts written after about 2005 that setting should be assumed to be no longer available and the coding should be done properly.

See http://www.felgall.com/htmlt59.htm for a short piece of code that can be added to a web page that has the same effect gor GET and POST variables as turning on register globals would have. The other global arrays can be dealt with similarly if you need to.

K, Thanks for the replies, i'll try to put in one of the methods suggested, though, i'll still be interested in making register_globals "on/off" from my script, b'coz some scripts like oscommerce and oscmax also require register_globals on!

K, Thanks for the replies, i'll try to put in one of the methods suggested, though, i'll still be interested in making register_globals "on/off" from my script, b'coz some scripts like oscommerce and oscmax also require register_globals on!

Only the old version of oscommerse required register globals on. If you are using the latest version with the correct security plugins then you must have it off.