Re: Questions on PHP Variables

From: Date: Sat, 09 Nov 2002 00:56:22 +0000
Subject: Re: Questions on PHP Variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123512@lists.php.net to get a copy of this message
They contain the same data. Newer versions of PHP (>= 4.1.1 I think) make use of the new superglobal arrays (like $_POST, $_GET, $_SESSION, $_COOKIE, $_SERVER, etc)... This way of doing things is more secure, and will encourage smarter programming. You can get the old behaviour back by changing register_globals to ON in your php.ini, but I'd encourage you to move forward to the new way of doing things... The fact that tutorials are outdated & using old code is not a good reason to stick with it :) Quick fix to get this script working is to put this near the top of the script: <? $PHP_AUTH_USER = $_SERVER["PHP_AUTH_USER"]; ?> Untested, but you should then be able to use the script as it currently is. Justin on 09/11/02 7:12 AM, Ray Seals (rseals@vdsi.net) wrote: > I'm running PHP 4.2.3 as an Apache Module > > When I try to use $PHP_AUTH_USER it returns nothing. But if I print out > $_SERVER["PHP_AUTH_USER"] it prints the user name I tried. > > All of the sample code and books that I have use the $PHP_AUTH_USER. > Can anyone give me some insight on what the difference is? > > Ray

« previous php.general (#123512) next »