ip checking
| From: | Worawisut Pinyoyang | Date: | Thu, 31 Aug 2000 17:32:04 +0000 |
| Subject: | ip checking | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-14646@lists.php.net to get a copy of this message | ||
i have a problem with my function that always return empty.
this is my code:
function return_ip() {
$ip = getenv("HTTP_X_FORWARDED_FOR");
if (!$ip)
{
$ip = getenv("REMOTE_ADDR");
}
return $ip;
}
when i use it:
$user_ip = return_ip();
echo "User IP: $user_ip ";
and the result:
User IP: (blank)
what's my problem and how do i solve it?
Thanks a lot
Worawisut