RE: [PHP] NULL Apache environment variables

2002-02-19 Thread Ford, Mike [LSS]

 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 5:58 PM
 To: Lars Torben Wilson
 
 Hm?  I didn't think that this was the case -- I thought that although 
 there is a long-term move to making 'register_globals = off' default, 
 register_globals is still default to be 'on'.  I think that this is 
 described in the 4.1.0 release announcement.

Indeed, the 4.1.0 release notes say this:

 PHP 4.1.0 still defaults to have register_globals set to on. [...]

 As of the next semi-major version of PHP, new installations of PHP will
 default to having register_globals set to off. No worries! Existing
 installations, which already have a php.ini file that has register_globals
 set to on, will not be affected.

... and the 4.1.1 release notes do not contradict this.  I took next semi-major 
version to mean 4.2.0, but if this change has actually occurred in 4.1.1 this should 
be made clear, both in the release notes and the manual section on Configuration.  
Perhaps it would have been better to state an actual version number, rather than an 
opaque phrase like next semi-major version.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Neil Freeman

Have a look at the function getenv()..

eg:
$ip = getenv (REMOTE_ADDR); // get the ip number of the user

HTH

Neil

Narvaez, Teresa wrote:

 Hello,
 I'm running PHP version 4.1.1.  When I invoke this function, ?php
 phpinfo()?, all variables are set.  However, when I try to retrieve a value
 of a certain variable like this:

   ?php echo $HTTP_USER_AGENT; ?

 It returns NULL.  Is there a missing configuration on apache or php?

 Thanks,
 -Teresa

 ***
  This message was virus checked with: SAVI 3.53 Jan 2002
  last updated 30th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




RE: [PHP] NULL Apache environment variables

2002-02-18 Thread Narvaez, Teresa

Thank you ... that worked! I did not know this because I looked at a sample
in www.php.net and the sample fails to call getenv().  

Thanks! 
-Teresa

-Original Message-
From: Neil Freeman [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 12:54 PM
To: Narvaez, Teresa
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] NULL Apache environment variables


Have a look at the function getenv()..

eg:
$ip = getenv (REMOTE_ADDR); // get the ip number of the user

HTH

Neil

Narvaez, Teresa wrote:

 Hello,
 I'm running PHP version 4.1.1.  When I invoke this function, ?php
 phpinfo()?, all variables are set.  However, when I try to retrieve a
value
 of a certain variable like this:

   ?php echo $HTTP_USER_AGENT; ?

 It returns NULL.  Is there a missing configuration on apache or php?

 Thanks,
 -Teresa

 ***
  This message was virus checked with: SAVI 3.53 Jan 2002
  last updated 30th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]





Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Lars Torben Wilson

On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote:
 Hello, 
   I'm running PHP version 4.1.1.  When I invoke this function, ?php
 phpinfo()?, all variables are set.  However, when I try to retrieve a value
 of a certain variable like this: 
 
   ?php echo $HTTP_USER_AGENT; ?  
 
 It returns NULL.  Is there a missing configuration on apache or php? 

As of PHP 4.1.0, register_globals is off by default since globals are so
icky. Try $_SERVER['HTTP_USER_AGENT'].

This should probably be made more obvious in the docs.


 Thanks, 
 -Teresa


Cheers,

Torben

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Erik Price


On Monday, February 18, 2002, at 05:44  PM, Lars Torben Wilson wrote:

 On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote:
 Hello,
  I'm running PHP version 4.1.1.  When I invoke this function, ?php
 phpinfo()?, all variables are set.  However, when I try to retrieve a 
 value
 of a certain variable like this:

   ?php echo $HTTP_USER_AGENT; ?

 It returns NULL.  Is there a missing configuration on apache or php?

 As of PHP 4.1.0, register_globals is off by default since globals are so
 icky. Try $_SERVER['HTTP_USER_AGENT'].

 This should probably be made more obvious in the docs.

Hm?  I didn't think that this was the case -- I thought that although 
there is a long-term move to making 'register_globals = off' default, 
register_globals is still default to be 'on'.  I think that this is 
described in the 4.1.0 release announcement.

http://www.php.net/release_4_1_0.php

In the 4.1.1 release announcement, it doesn't say that anything about 
this has changed.  I'm not trying to contradict you Torben, but if this 
is true then it is not documented in the news at the web site.


Please correct me.
- Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Lars Torben Wilson

On Mon, 2002-02-18 at 14:58, Erik Price wrote:
 
 On Monday, February 18, 2002, at 05:44  PM, Lars Torben Wilson wrote:
 
  On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote:
  Hello,
 I'm running PHP version 4.1.1.  When I invoke this function, ?php
  phpinfo()?, all variables are set.  However, when I try to retrieve a 
  value
  of a certain variable like this:
 
?php echo $HTTP_USER_AGENT; ?
 
  It returns NULL.  Is there a missing configuration on apache or php?
 
  As of PHP 4.1.0, register_globals is off by default since globals are so
  icky. Try $_SERVER['HTTP_USER_AGENT'].
 
  This should probably be made more obvious in the docs.
 
 Hm?  I didn't think that this was the case -- I thought that although 
 there is a long-term move to making 'register_globals = off' default, 
 register_globals is still default to be 'on'.  I think that this is 
 described in the 4.1.0 release announcement.
 
 http://www.php.net/release_4_1_0.php
 
 In the 4.1.1 release announcement, it doesn't say that anything about 
 this has changed.  I'm not trying to contradict you Torben, but if this 
 is true then it is not documented in the news at the web site.
 
 
 Please correct me.

No, I can't--you're correct. :)

 - Erik

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




RE: [PHP] NULL Apache environment variables

2002-02-18 Thread Narvaez, Teresa

The function call phpinfo() shows register_globals=off for master and local
value on my system.  I installed PHP and did not change anything because I
do not know enough to make changes so I believe off is the default value.  

Thanks, 
-Teresa


-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 5:58 PM
To: Lars Torben Wilson
Cc: Narvaez, Teresa; [EMAIL PROTECTED]
Subject: Re: [PHP] NULL Apache environment variables



On Monday, February 18, 2002, at 05:44  PM, Lars Torben Wilson wrote:

 On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote:
 Hello,
  I'm running PHP version 4.1.1.  When I invoke this function, ?php
 phpinfo()?, all variables are set.  However, when I try to retrieve a 
 value
 of a certain variable like this:

   ?php echo $HTTP_USER_AGENT; ?

 It returns NULL.  Is there a missing configuration on apache or php?

 As of PHP 4.1.0, register_globals is off by default since globals are so
 icky. Try $_SERVER['HTTP_USER_AGENT'].

 This should probably be made more obvious in the docs.

Hm?  I didn't think that this was the case -- I thought that although 
there is a long-term move to making 'register_globals = off' default, 
register_globals is still default to be 'on'.  I think that this is 
described in the 4.1.0 release announcement.

http://www.php.net/release_4_1_0.php

In the 4.1.1 release announcement, it doesn't say that anything about 
this has changed.  I'm not trying to contradict you Torben, but if this 
is true then it is not documented in the news at the web site.


Please correct me.
- Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]



Re: [PHP] NULL Apache environment variables

2002-02-18 Thread Erik Price


On Monday, February 18, 2002, at 06:11  PM, Narvaez, Teresa wrote:

 The function call phpinfo() shows register_globals=off for master and
 local
 value on my system.  I installed PHP and did not change anything because
 I
 do not know enough to make changes so I believe off is the default
 value.


Hm.  That's very strange.  Did you install someone else's pre-compiled 
binary?  I know that my 4.1.0 source install ended up with 
register_globals = on by default, and I had to manually change this to 
off.  But that was over a month ago.

There are others on this list more knowledgeable than I about the 
default setup of the php.ini file.  In any event Teresa, you are much 
better off learning PHP with register_globals = off because it will get 
you used to using $_* arrays, as the old globalized means of accessing 
variables has been deprecated.  So don't change anything.  :)


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] NULL Apache environment variables

2002-02-18 Thread Narvaez, Teresa

Erik, 
Thanks for your response.  No I did not install a pre-compiled
binary.  I got the tar ball and compiled it myself.  By the way, I am
running PHP version 4.1.1.

Thanks for all the help!
-Teresa

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 6:45 PM
To: Narvaez, Teresa
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] NULL Apache environment variables



On Monday, February 18, 2002, at 06:11  PM, Narvaez, Teresa wrote:

 The function call phpinfo() shows register_globals=off for master and
 local
 value on my system.  I installed PHP and did not change anything because
 I
 do not know enough to make changes so I believe off is the default
 value.


Hm.  That's very strange.  Did you install someone else's pre-compiled 
binary?  I know that my 4.1.0 source install ended up with 
register_globals = on by default, and I had to manually change this to 
off.  But that was over a month ago.

There are others on this list more knowledgeable than I about the 
default setup of the php.ini file.  In any event Teresa, you are much 
better off learning PHP with register_globals = off because it will get 
you used to using $_* arrays, as the old globalized means of accessing 
variables has been deprecated.  So don't change anything.  :)


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]