PDA

Click to See Complete Forum and Search --> : how to get hostname and ISP from an ip ?


tony007
May 13th, 2007, 01:13 PM
Hi all could any one show me how i can get host name,isp,connection type from given ip ?I am looking for a php script that i be able to host and does the job me.Thanks

sunburnt
May 14th, 2007, 05:26 PM
You can get the hostname from an IP address using the gethostbyaddr() function:


echo gethostbyaddr($_SERVER['REMOTE_ADDR']);


As for "isp", you'll probably need to do some lookups on the hostname/and or address, but I'm not sure exactly how.

tony007
May 14th, 2007, 11:18 PM
You can get the hostname from an IP address using the gethostbyaddr() function:


echo gethostbyaddr($_SERVER['REMOTE_ADDR']);


As for "isp", you'll probably need to do some lookups on the hostname/and or address, but I'm not sure exactly how.
But if do like this it willn't work :

echo gethostbyaddr(69.105.29.93 );

If i knew how to get the isp i was not asking it in the first place!!:eek2:

dclamp
May 14th, 2007, 11:19 PM
try using quotes (" ") and deleteing the space at the end.