So I have been wondering, how do sites like
http://whatismyipaddress.com/ gather so much information from an IP address? Where do they grab the information from?
If I was to create an IP locator, how would I go about doing it?
Thanks a lot,
- Jack
Not sure, but to print IP's then example PHP would be:
Code:
?echo $_SERVER['REMOTE_ADDR'];?>
Theres a site that says the browser the person is using/ ip/ router
I was more wondering about the information gathered from the IP address. Such as ISP, Host, City, Country, Proxy, etc...
I'm guessing they somehow request it through the ISP. Not all are 100% my IP is traced to a couple of miles away from where I actually live.
There are several pre-defined functions in PHP.
To be honest I would just use a site rather than make one..
http://www.geobytes.com/IpLocator.htm
(08-29-2010, 09:17 AM)Fragma Wrote: [ -> ]I was more wondering about the information gathered from the IP address. Such as ISP, Host, City, Country, Proxy, etc...
IP address
PHP Code:
<?php $_SERVER['REMOTE_ADDR'] ?>
Host
PHP Code:
<?php $_SERVER['REMOTE_HOST'] ?>
Browser info..
PHP Code:
<?php $_SERVER['HTTP_USER_AGENT'] ?>
Small javascript I have which will make your work simple.
PHP Code:
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<br>Country Code:
<script language="JavaScript">document.write(geoip_country_code());</script>
<br>Country Name:
<script language="JavaScript">document.write(geoip_country_name());</script>
<br>City:
<script language="JavaScript">document.write(geoip_city());</script>
<br>Region:
<script language="JavaScript">document.write(geoip_region());</script>
<br>Region Name:
<script language="JavaScript">document.write(geoip_region_name());</script>
<br>Latitude:
<script language="JavaScript">document.write(geoip_latitude());</script>
<br>Longitude:
<script language="JavaScript">document.write(geoip_longitude());</script>
<br>Postal Code:
<script language="JavaScript">document.write(geoip_postal_code());</script>
Hope, I helped you.
Thanks but I was actually wanting to implement this into a desktop application without having to use a website like
http://whatismyipaddress.com/ to gather the information.
Sorry but you have misunderstood totally. I want to know the process in which websites gather so much information purely by having an IP address. Where do they get the information from?