Page 1 of 1

GETENV does not get any environment since upgrade...

Posted: Thu Dec 18, 2003 5:46 am
by derschamane
I have a script with the GETENV function, where i read some Environment Variables like REMOTE_ADDR.
It worked perfectly on IIS5.0 and php 4.3.2.
Now my friend, who is the owner of the server has upgraded to IIS6.0
and php 4.3.4. Since this I don't get any environment information.
The function GETENV delivers empty strings.

Any IDEAS and suggestions are very welcome...

Ewald, der.moderne.Schamane
http://www.schamane.cc

dermoderneschamane@yahoo.de

Posted: Thu Dec 18, 2003 6:31 am
by JayBird
Not a solution but..

To be honest, i wouldn't use the GETENV function, i would get the environment variables using the $_SERVER varaible.

Code: Select all

$_SERVER["REMOTE_ADDR"]
Mark

Does not help...

Posted: Thu Dec 18, 2003 6:37 am
by derschamane
Thanks for the tipp, but as long as the SERVER does not deliver any Variables, $_SERVER does not work. As you said... not a solution...

ANYWAY, THANKS FOR YOUR FAST ANSWER,
Ewald

Posted: Thu Dec 18, 2003 6:41 am
by JayBird
$_SERVER may return the information that GETENV isn't. GETENV can be disabled.

Try the code i gave in my previous post and see if it returns anything.

Mark

Posted: Fri Dec 19, 2003 5:51 am
by twigletmac
Always a plan to do:

Code: Select all

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
when you change webserver to check on the variables you have access to and those that may no longer be available.

Mac

THANK YOU... $_SERVER works

Posted: Fri Dec 19, 2003 6:17 am
by derschamane
I PROMISE, that next time, I first TRY, and then REPLY ;-)
$_SERVER works perfect and delivers the information I need.

Thank you for your fast and helpful responses.

Regards
Ewald, derSchamane
http://www.schamane.cc