Posted by pangea33 on 11/04/06 07:25
brett wrote:
> I can get the IP address of a visitor on my site by
>
> $_SERVER['REMOTE_ADDR'];
>
> how do I get the corresponding URL. If the user is on Comcast, the URL
> (host name) may look like:
>
> d-20-19-24-30.hsd3.la.comcast.net
>
> That's the value I'm after.
>
> Thanks,
> Brett
Just use the gethostbyaddr() function...
<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $hostname;
?>
[Back to original message]
|