Re: diplaying the path

From: Date: Fri, 31 May 2002 23:52:29 +0000
Subject: Re: diplaying the path
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-100194@lists.php.net to get a copy of this message
> the bad thing about the BTW seciton is, is that it is not true inside of a > function, that is the reason I refered to it as $GLOBALS['HTTP_REFERER'] That's not bad, it's a feature of PHP :) All variables (even predefined variables) follow standard PHP variable scope rules (except superglobals) so 'global' is then used inside functions. For those interested: http://www.php.net/manual/en/language.variables.scope.php http://www.php.net/manual/en/language.variables.predefined.php But more importantly, the reason I responded is because your words contained no specifics, I felt it was important enough to mention some. Regards, Philip Olson > > Jim lucas > ----- Original Message ----- > From: "Philip Olson" <philip@cornado.com> > To: "Jim lucas" <phplist@zonedzero.net> > Cc: "Kris Vose" <KVose@alidaconnection.com>; <php-general@lists.php.net> > Sent: Friday, May 31, 2002 11:03 AM > Subject: Re: [PHP] diplaying the path > > > > actually: > > > > If the php directive register_globals is on, then > > $HTTP_REFERER will exist. Otherwise it will not. > > (or course that assumes a value exists at all). > > > > Regardless of the register_globals setting, you > > can do: > > > > // Works since PHP 3 (forever)* > > print $HTTP_SERVER_VARS['HTTP_REFERER']; > > > > // Works since PHP 4.1.0 > > print $_SERVER['HTTP_REFERER']; > > > > Btw, $GLOBALS['HTTP_REFERER'] === $HTTP_REFERER. > > And lastly, since PHP 4.2.0 the register_globals > > directive defaults to off, which is what Jim was > > indirectly referring to. See also extract(). > > > > Regards, > > Philip Olson > > > > * For versions older then 4.0.3 see also the > > track_vars directive, it should be on. > > > > > > On Fri, 31 May 2002, Jim lucas wrote: > > > > > depending on what version of php you are running, you can use > > > $GLOBALS['HTTP_REFERER'] or on newer versions you can use > > > $_SERVER['HTTP_REFERER'] > > > > > > Jim Lucas > > > ----- Original Message ----- > > > From: "Kris Vose" <KVose@alidaconnection.com> > > > To: <php-general@lists.php.net> > > > Sent: Friday, May 31, 2002 9:19 AM > > > Subject: [PHP] diplaying the path > > > > > > > > > > Is there a variable/function in php that will display the url location > of > > > the hyper-link that brought them to the current page. Thanks in > advance. > > > > > > > > Kris Vose > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#100194) next »