[PHP] a simple getenv question....

2003-01-22 Thread Bruce Douglas
Hi...

A simple question... In the following code:

?

$ip = getenv(REMOTE_ADDR);

echo  ip = .$ip;

echo  ip =  . getenv(REMOTE_ADDR);

echo  ip =  . getenv('REMOTE_ADDR');

echo  ip = . $REMOTE_ADDR;--

?

I can only seem to get the last line to display the correct value. It's as
if I can't seem to get/return any of the SERVER environment variables using
the getenv() function

I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.

I've checked through the PHP.INI file, but couldn't seem to find why this
might be occuring. Any help/assistance would be appreciated.

thanks

bruce
[EMAIL PROTECTED]



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




Re: [PHP] a simple getenv question....

2003-01-22 Thread Jim Lucas
just copied your code and it worked fine for me.

system: Apache 1.3.26
PHP 4.2.2

I would look into apache 2.0 and the env vars that are available from it.


- Original Message -
From: Bruce Douglas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 3:57 PM
Subject: [PHP] a simple getenv question


 Hi...

 A simple question... In the following code:

 ?

 $ip = getenv(REMOTE_ADDR);

 echo  ip = .$ip;

 echo  ip =  . getenv(REMOTE_ADDR);

 echo  ip =  . getenv('REMOTE_ADDR');

 echo  ip = . $REMOTE_ADDR; --

 ?

 I can only seem to get the last line to display the correct value. It's as
 if I can't seem to get/return any of the SERVER environment variables
using
 the getenv() function

 I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.

 I've checked through the PHP.INI file, but couldn't seem to find why this
 might be occuring. Any help/assistance would be appreciated.

 thanks

 bruce
 [EMAIL PROTECTED]



 --
 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] a simple getenv question....

2003-01-22 Thread Timothy Hitchens \(HiTCHO\)
The simplest way to start looking would be phpinfo() page for starters.


Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Jim Lucas [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, 23 January 2003 10:15 AM
 To: Bruce Douglas; [EMAIL PROTECTED]
 Subject: Re: [PHP] a simple getenv question
 
 
 just copied your code and it worked fine for me.
 
 system: Apache 1.3.26
 PHP 4.2.2
 
 I would look into apache 2.0 and the env vars that are 
 available from it.
 
 
 - Original Message -
 From: Bruce Douglas [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, January 22, 2003 3:57 PM
 Subject: [PHP] a simple getenv question
 
 
  Hi...
 
  A simple question... In the following code:
 
  ?
 
  $ip = getenv(REMOTE_ADDR);
 
  echo  ip = .$ip;
 
  echo  ip =  . getenv(REMOTE_ADDR);
 
  echo  ip =  . getenv('REMOTE_ADDR');
 
  echo  ip = . $REMOTE_ADDR; --
 
  ?
 
  I can only seem to get the last line to display the correct value. 
  It's as if I can't seem to get/return any of the SERVER environment 
  variables
 using
  the getenv() function
 
  I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.
 
  I've checked through the PHP.INI file, but couldn't seem to 
 find why 
  this might be occuring. Any help/assistance would be 
 appreciated.
 
  thanks
 
  bruce
  [EMAIL PROTECTED]
 
 
 
  --
  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
 


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




RE: [PHP] a simple getenv question....

2003-01-22 Thread Bruce Douglas
phpinfo() returns everything as expected.. but not having the code .. i
don't know what internal method it uses to access the information...

but thanks...

-bruce


-Original Message-
From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 4:18 PM
To: 'Jim Lucas'; 'Bruce Douglas'; [EMAIL PROTECTED]
Subject: RE: [PHP] a simple getenv question


The simplest way to start looking would be phpinfo() page for starters.


Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Jim Lucas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 23 January 2003 10:15 AM
 To: Bruce Douglas; [EMAIL PROTECTED]
 Subject: Re: [PHP] a simple getenv question


 just copied your code and it worked fine for me.

 system: Apache 1.3.26
 PHP 4.2.2

 I would look into apache 2.0 and the env vars that are
 available from it.


 - Original Message -
 From: Bruce Douglas [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, January 22, 2003 3:57 PM
 Subject: [PHP] a simple getenv question


  Hi...
 
  A simple question... In the following code:
 
  ?
 
  $ip = getenv(REMOTE_ADDR);
 
  echo  ip = .$ip;
 
  echo  ip =  . getenv(REMOTE_ADDR);
 
  echo  ip =  . getenv('REMOTE_ADDR');
 
  echo  ip = . $REMOTE_ADDR; --
 
  ?
 
  I can only seem to get the last line to display the correct value.
  It's as if I can't seem to get/return any of the SERVER environment
  variables
 using
  the getenv() function
 
  I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.
 
  I've checked through the PHP.INI file, but couldn't seem to
 find why
  this might be occuring. Any help/assistance would be
 appreciated.
 
  thanks
 
  bruce
  [EMAIL PROTECTED]
 
 
 
  --
  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



--
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] a simple getenv question....

2003-01-22 Thread Timothy Hitchens \(HiTCHO\)
Do this:

?php

print_r($_SERVER);

?

If what you want is here this just use: $_SERVER['REMOTE_ADDR'] etc

You will need to have a look at the source of the output as the rendered
view will look a little strange.



Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Bruce Douglas [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, 23 January 2003 10:33 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] a simple getenv question
 
 
 phpinfo() returns everything as expected.. but not having the 
 code .. i don't know what internal method it uses to access 
 the information...
 
 but thanks...
 
 -bruce
 
 
 -Original Message-
 From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 4:18 PM
 To: 'Jim Lucas'; 'Bruce Douglas'; [EMAIL PROTECTED]
 Subject: RE: [PHP] a simple getenv question
 
 
 The simplest way to start looking would be phpinfo() page for 
 starters.
 
 
 Timothy Hitchens (HiTCHO)
 Open Source Consulting
 e-mail: [EMAIL PROTECTED]
 
  -Original Message-
  From: Jim Lucas [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, 23 January 2003 10:15 AM
  To: Bruce Douglas; [EMAIL PROTECTED]
  Subject: Re: [PHP] a simple getenv question
 
 
  just copied your code and it worked fine for me.
 
  system: Apache 1.3.26
  PHP 4.2.2
 
  I would look into apache 2.0 and the env vars that are 
 available from 
  it.
 
 
  - Original Message -
  From: Bruce Douglas [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, January 22, 2003 3:57 PM
  Subject: [PHP] a simple getenv question
 
 
   Hi...
  
   A simple question... In the following code:
  
   ?
  
   $ip = getenv(REMOTE_ADDR);
  
   echo  ip = .$ip;
  
   echo  ip =  . getenv(REMOTE_ADDR);
  
   echo  ip =  . getenv('REMOTE_ADDR');
  
   echo  ip = . $REMOTE_ADDR; --
  
   ?
  
   I can only seem to get the last line to display the 
 correct value. 
   It's as if I can't seem to get/return any of the SERVER 
 environment 
   variables
  using
   the getenv() function
  
   I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.
  
   I've checked through the PHP.INI file, but couldn't seem to
  find why
   this might be occuring. Any help/assistance would be
  appreciated.
  
   thanks
  
   bruce
   [EMAIL PROTECTED]
  
  
  
   --
   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
 
 
 
 --
 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
 


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




RE: [PHP] a simple getenv question....

2003-01-22 Thread Bruce Douglas
Timothy,

Thanks for your input.. but I was trying to get a better understanding as to
why the getenv() function was apparently not returning the SERVER
environment vars.

thanks

-bruce


-Original Message-
From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 22, 2003 4:39 PM
To: 'Bruce Douglas'; [EMAIL PROTECTED]
Subject: RE: [PHP] a simple getenv question


Do this:

?php

print_r($_SERVER);

?

If what you want is here this just use: $_SERVER['REMOTE_ADDR'] etc

You will need to have a look at the source of the output as the rendered
view will look a little strange.



Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Bruce Douglas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 23 January 2003 10:33 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] a simple getenv question


 phpinfo() returns everything as expected.. but not having the
 code .. i don't know what internal method it uses to access
 the information...

 but thanks...

 -bruce


 -Original Message-
 From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 4:18 PM
 To: 'Jim Lucas'; 'Bruce Douglas'; [EMAIL PROTECTED]
 Subject: RE: [PHP] a simple getenv question


 The simplest way to start looking would be phpinfo() page for
 starters.


 Timothy Hitchens (HiTCHO)
 Open Source Consulting
 e-mail: [EMAIL PROTECTED]

  -Original Message-
  From: Jim Lucas [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, 23 January 2003 10:15 AM
  To: Bruce Douglas; [EMAIL PROTECTED]
  Subject: Re: [PHP] a simple getenv question
 
 
  just copied your code and it worked fine for me.
 
  system: Apache 1.3.26
  PHP 4.2.2
 
  I would look into apache 2.0 and the env vars that are
 available from
  it.
 
 
  - Original Message -
  From: Bruce Douglas [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, January 22, 2003 3:57 PM
  Subject: [PHP] a simple getenv question
 
 
   Hi...
  
   A simple question... In the following code:
  
   ?
  
   $ip = getenv(REMOTE_ADDR);
  
   echo  ip = .$ip;
  
   echo  ip =  . getenv(REMOTE_ADDR);
  
   echo  ip =  . getenv('REMOTE_ADDR');
  
   echo  ip = . $REMOTE_ADDR; --
  
   ?
  
   I can only seem to get the last line to display the
 correct value.
   It's as if I can't seem to get/return any of the SERVER
 environment
   variables
  using
   the getenv() function
  
   I'm using Apache 2.0.40, PHP 4.2.2 on Linux RedHat 8.0.
  
   I've checked through the PHP.INI file, but couldn't seem to
  find why
   this might be occuring. Any help/assistance would be
  appreciated.
  
   thanks
  
   bruce
   [EMAIL PROTECTED]
  
  
  
   --
   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
 


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



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