RE: [PHP-WIN] IP address reference
| From: | brother | Date: | Mon, 11 Feb 2002 16:44:17 +0000 |
| Subject: | RE: [PHP-WIN] IP address reference | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-11967@lists.php.net to get a copy of this message | ||
<?
if (getenv ("HTTP_X_FORWARDED_FOR")) {
$ip = getenv ("HTTP_X_FORWARDED_FOR");
} else {
$ip = getenv ("REMOTE_ADDR");
}
$host = gethostbyaddr ($ip);
system ("ping $host");
?>
This script will ping the users real adress.
/bro.
> -----Original Message-----
> From: Tal-ee Roberts [mailto:troberts@binghamton.edu]
> Sent: den 11 februari 2002 16:42
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] IP address reference
>
>
> Is there any way to get the user's ip address using PHP?
> thanks -Tal-ee