Re: $HTTP_GET_VARS within a function ??

From: Date: Mon, 14 Oct 2002 09:41:52 +0000
Subject: Re: $HTTP_GET_VARS within a function ??
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-119857@lists.php.net to get a copy of this message
http://localhost/test.php?var=5 results in (global scope) $var = 5; // Register globals on $HTTP_GET_VARS['var'] = 5; // Always (?) $_GET['var'] = 5; // With newer versions of PHP To access this from a function: function x() { global $var; globsl $HTTP_GET_VARS; echo $var.'<BR>'; echo $HTTP_GET_VARS['var'].'<BR>'; echo $_GET['var'].'<BR>'; } Note, that there is no "global $_GET;" - $_GET is a superglobal. That means, you can always access it. Sascha Am Montag, 14. Oktober 2002 09:50 schrieb John Negretti: > Jason, > > What is the difference? > > > "Jason Wong" <php-general@gremlins.com.hk> wrote in message > news:200210141346.33289.php-general@gremlins.com.hk... > > > On Monday 14 October 2002 08:36, John Negretti wrote: > > > Marco, > > > > > > I was reading that there were some security risks with > > > "register-globals". Is this the same thing as "global". > > > > No, they're totally different things. > > > > -- > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > Open Source Software Systems Integrators > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > /* > > Never promise more than you can perform. > > -- Publilius Syrus > > */

« previous php.general (#119857) next »