Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php register globals on/off through .htaccess

I have 2 scritpts on 2 different folders. One on them need the register globals to On and the other to Off.

Is it possible to enable regsiter globals on one folder and disable it on another one ? (maybe with a .htaccess ?)

regards

like image 832
yarek Avatar asked Sep 15 '10 10:09

yarek


2 Answers

if your apache instance allows you to override flags through .htaccess you can put the following in your file:

php_flag register_globals off
like image 51
knittl Avatar answered Oct 23 '22 13:10

knittl


I have a login script that works like this: User type username and pass, if ok then save user data in a session and redirect to restrict area. I hosted my site in bluehost.com and it works perfectly. So for some reasons I've decided to change to hostgator.com and session stopped save data from user. All I have to do is add to php.ini a line to disable register_globals

register_globals=Off
like image 43
Vinicius Avatar answered Oct 23 '22 13:10

Vinicius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!