Click to See Complete Forum and Search --> : 4.2.1 access global variables?


martinj
05-17-2002, 09:34 AM
I cannot access my usage of $PHP_SELF. I have made extension use of this variable and do not want to change all the locations now.
I attempted to fix the problem by tuning the cofiguration files as follows:

php.ini:
register_globals On

httpd.conf:
AllowOveride All

BUT I STILL CANNOT ACCESS PHP_SELF!

How else can I solve this problem? I noticed that my new distribution of PHP is putting php.ini in /etc instead of /usr/local/lib. Do I need to tell Apache about this change of location?

Thanks for any help,

Jeff

martinj
05-17-2002, 06:13 PM
the rpm install of php placed php.ini into the etc directory. when i installed php-4.2.1 myself i needed to copy php.ini into /usr/local/lib and then set register_globals to On. works fine now.

i do wonder what the future holds for these global variables. it would appear that i may need to make massive changes in my use of POST and SYSTEM variables in order to use the new scheme.

for now i am thankful for the register_globals flag.

jeff

Anon
05-18-2002, 03:47 AM
You could just use $_SERVER['PHP_SELF'] and leave the global variables off. It's more secure to leave the globals off.