Page 1 of 1
Check wether Globals are on/off
Posted: Wed Oct 02, 2002 6:51 pm
by nike
Hi,
how can I check in PHP wether the globals are registered on or off?
A short code snippet would be nice
Bye
Nike
Posted: Wed Oct 02, 2002 8:29 pm
by volka
take a look at
Code: Select all
<?php
var_dump(ini_get('register_globals'));
?>
with different values for register_globals
Code: Select all
if (ini_get('register_globals'))
{
//register_globals on
}
else
{
//register_globals off
}
Posted: Thu Oct 03, 2002 2:12 am
by twigletmac
Further to Volka's answer and relating to finding out even more information about how PHP is setup...
If you want to find out information like this on your own installation of PHP do a search in your files and have a look at your php.ini file. Alternatively you could try putting
into a file and running it. That'll tell you everything you need to know about how PHP is configured and what's been enabled and what hasn't (and you can look at this even if you don't have access to the php.ini file, if for example you want to look at your host's PHP config).
Mac
Thank you
Posted: Sun Oct 06, 2002 7:10 pm
by nike
Hi,
thank you for the info.
I knew that phpinfo thingy

I just needed the iniget Volka supplied - thank you for that one Volka -
Bye
Nike
P.S. Sorry, the next time I´ll read the manual
even more thoroughly - promise.