here is your problem, getenv() takes a string, the name of the variable, not the actual $variable itself
you need:
<?php
$address = getenv('REMOTE_ADDR');
echo "Your IP address is $address.";
?>
read more at:
http://www.php.net/manual/en/function.getenv.php
detailed explaination:
<?php
$address = getenv($_SERVER['REMOTE_ADDR']);
echo "Your IP address is $address.";
?>
first php interprets your $ variables on the right of =.
It will look in $_SERVER for 'REMOTE_ADDR'.
so you then get
<?php
$address = getenv(127.0.0.1);
echo "Your IP address is $address.";
?>
then it will hit your getenv: it will not find a variable called '127.0.0.1' so will return an empty or NULL value, which it is failthfully printing in your results..
<?php
$address = NULL;
echo "Your IP address is $address.";
?>
when it gets around to evaluating $address you will get
<?php
echo "Your IP address is .";
?>
and print
'Your IP address is .