Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-14 Thread John Negretti

Jason,

What is the difference?


Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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
 */




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-14 Thread Sascha Cunz


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 [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  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
  */


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-13 Thread Marco Tabini

Try using 

global $HTTP_GET_VARS;

at the beginning of your function. $HTTP_GET_VARS has global scope, and
by default PHP isolates functions from the parent scope.


Marco

On Sun, 2002-10-13 at 16:39, John Negretti wrote:
 Hello All,
 
 I am calling a particular function.  Within that function I need access
 to the $HTTP_GET_VARS array.  It seem I could only access that array if I
 pass it as a parameter of the function.  Is this how it's supposed to work.
 Thanks for any direction.  NOTE: I am using PHP 4.0.6.
 
   John Negretti
   www.ideablue.com
 
 
 
 
 -- 
 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




Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-13 Thread John Negretti

Marco,

I was reading that there were some security risks with
register-globals.  Is this the same thing as global.

John Negretti
www.ideablue.com


Marco Tabini [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Try using

 global $HTTP_GET_VARS;

 at the beginning of your function. $HTTP_GET_VARS has global scope, and
 by default PHP isolates functions from the parent scope.


 Marco

 On Sun, 2002-10-13 at 16:39, John Negretti wrote:
  Hello All,
 
  I am calling a particular function.  Within that function I need
access
  to the $HTTP_GET_VARS array.  It seem I could only access that array if
I
  pass it as a parameter of the function.  Is this how it's supposed to
work.
  Thanks for any direction.  NOTE: I am using PHP 4.0.6.
 
John Negretti
www.ideablue.com
 
 
 
 
  --
  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




Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-13 Thread Jason Wong

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
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php