Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- getenv() function question


madcat - 5:13 pm on Oct 11, 2002 (gmt 0)


I'll check it out really...but php.net has as example:

<?php
$address = getenv('REMOTE_ADDR');
echo "Your IP address is $address.";
?>

>> Your IP address is .
-------------------------------------------------
Using:

<?php
$address = $_SERVER['HTTP_USER_AGENT'];
echo "Your IP address is $address.";
?>
OR...
<?php
$address = $_SERVER['REMOTE_ADDR'];
echo "Your IP address is $address.";
?>

Work correctly- so are they wrong to use? Is getenv() necessary? I'm using PHP 4.2.2- just a bit confusing when your trying to learn.

Thanks-


Thread source:: http://www.webmasterworld.com/php/1122.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com