Jump to content

get ip address Location City


proctk

Recommended Posts

When I read your question I didn't think they could look-up my location, but after visiting that site, I know they can't.

 

When I visited it said:

 

"Reston, VA, UNITED STATES

IP found in 0.0079 seconds"

 

I am in San Dimas, CA (Los Angeles) not Reston, VA.

 

UPDATE:

Upon further investigation I see what they are doing. They are building their own database, where the users enter the information for their IP address. Based on that they run a script which tries to guess your location based on previous entires. This is obviously an inaccurate way of determining an IP address, since they got mine wrong.

 

I would guess the more user submitted info they get the more accurate it will become in the future.

 

But there is now way to just get an IP and say you're here.

Link to comment
Share on other sites

I think they either they have edited geoIP dat File by themselves and then using that.

or Maxmind IP Database (they have edited that)

It didn't Show my location correctly

I am From India -> Calcutta they Shown India -> Tiruchirapally

mile away from my location

Link to comment
Share on other sites

link=topic=136132.msg574944#msg574944 date=1176659990]

they got the ip and country right on me... but the city...hehe...ehm... it's on the other side of norway from where I live...

Its Simple probability of getting errors in country in very very low. where as its high in case of city.

GeoIp is the best Solution.

Link to comment
Share on other sites

please try this script and tell me if it works or not:

<?php 
$ip = $_GET['ip'];
$content = file("http://api.hostip.info/get_html.php?ip=$ip&position=true");
$country = str_replace("Country: ", "", $content[0]);
$city = str_replace("City: ", "", $content[1]);
$lat = str_replace("Latitude: ", "", $content[2]);
$long = str_replace("Longitude: ", "", $content[3]);
echo "Country: $country<br />";
echo "City: $city<br />";
echo "Google Map: <a href=\"http://maps.google.com/maps?ll=$lat,$long\">Link</a><br />";
?>

Link to comment
Share on other sites

Thank you for the help that worked excellent, for the people that get a different city I'm thinking its because the persons ISP head office is in that city and that is here that ip addess is assigned.  this is just an educated guess

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.