I run LAMP env, and my server is running DNS.
L-Linux
A-Apache
M-MySql
P-PHP

When I use REMOTE_ADDR, always return my server ip instead of user ip (because I control DNS server?), how can I solve this issue before I try to write some function?

Here is the part of simple code:
//track visitor information
<?
$ip = (getenv(HTTP_X_FORWARDED_FOR))
? getenv(HTTP_X_FORWARDED_FOR)
: getenv(REMOTE_ADDR);
?>
<div align="center"><h3>
Let me guess:
Your IP is <?=$ip?><br>
Your ISP is <?=gethostbyaddr($ip)?><br>
</h3></div>

Thanks.