Re: Accessing PHP Globals

From: Date: Thu, 29 Jul 2004 20:32:41 +0000
Subject: Re: Accessing PHP Globals
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-14012@lists.php.net to get a copy of this message
On Thu, 2004-07-29 at 09:41, S.D.Price wrote: > Hi, can anyone help me - I want to be able to access global variables > using PHP with Apache 2.0 on windows 2000. I would like to access > globals such as $php_self $http_user_agent, but this seems to be > switched off. Does anyone know how to alter this? > > > Steve Yes, its register_globals in php.ini and it is off by default. You can turn it on (don't forget to bounce the webserver) but it is intentionally off by default for security reasons. These are shown in php.ini and in the PHP manual. Global variables are something of a security risk, so it is recommended to keep them off. You can still get at all these things, but in a slightly different way. Get parameters are accesses as $_GET['name'}, post variables as $_POST['name'], php_self as $_SERVER['PHP_SELF'], $http_user_agent as $_SERVER['HTTP_USER_AGENT']. Regards Chris

« previous php.install (#14012) next »