RE: [PHP-WIN] Getting users IP Address
| From: | brother | Date: | Tue, 02 Jul 2002 14:41:17 +0000 |
| Subject: | RE: [PHP-WIN] Getting users IP Address | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-14532@lists.php.net to get a copy of this message | ||
This script will make the server ping the visitor =)
<?
if (getenv ("HTTP_X_FORWARDED_FOR")) {
$ip = getenv ("HTTP_X_FORWARDED_FOR");
} else {
$ip = getenv ("REMOTE_ADDR");
}
$lastline = exec( "ping $ip", $resultsArray );
for($i=0; $i < sizeof($resultsArray); $i++)
{
echo $resultsArray[$i] . '<br>';
}
?>
> -----Original Message-----
> From: R.S. Herhuth [mailto:ronherhuth@pop.mindspring.com]
> Sent: den 2 juli 2002 16:17
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Getting users IP Address
>
>
>
> How do I get a users IP address using either Javascript or PHP?
>
> Thanks,
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>