![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
King of Portal
|
Geolocation through IPs
Before I start let me say that I have no idea how it is that latitude and longitude are determined from an IP address. I'm unsure if all methods use some sort of database, or if there's an actual way to determine the location based on the constituent numbers of the address. In any case, I found a website which allows you to type in an IP address and it provides the geographic data free of charge. So what I did was I used PHP to parse the content of this page into an array format and then store it in a database. Then another script turns it into a variable and passes the geographical information to a Flash file. Finally, this Flash file translates onto a globe the approximate positions of these regions. I just did this as a nifty little trick for tracking where people are accessing the main page of my software from. Thought someone might like to see it. Limitations: It only tracks the people that access the front page of my site, and it doesn't update dynamically. Sadly, the awardspace server won't allow me to use the PHP function file_get_contents() beyond the scope of the local URL. I'm forced to update the map's database files by hand.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
It's strictly database, as there's no strict relation to lat/long. You can get DBs via a Google search. Nice implementation, though.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
What was the site that you got the long and lat points from? You might want to think about downloading a PHP Proxy and looking at the code that it uses to retrieve the website and adapt it for your site. If you are still needing to use the php function to access a site and can't do it, install PHP and MySQL onto a machine at home and run all the ip addresses through and have it load into the mysql database or have it be called by your current webserver and then have it return the long and lat points. If that makes any sense.
|
|
|
|
|
|
#4 | ||||
|
King of Portal
|
Quote:
Quote:
Quote:
Quote:
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
||||
|
|
|
|
|
#5 | |
|
Hobbyist Programmer
|
a PHP Proxy, is a web based proxy: http://www.phproxy.org/ to where it's coded in php. Then again it sounds like you've already done something like it. You could probably automate that whole process that you use:
Quote:
|
|
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Oct 2006
Posts: 146
Rep Power: 2
![]() |
well it says im in pennsylvania, LOL im not even close really...
|
|
|
|
|
|
#7 |
|
Programming Guru
![]() ![]() ![]() |
I suppose it is where your IP is registered... not necessarily your physical location.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#8 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Yup. Mine shows about 100 miles southeast. My site's server is in Toronto, but its IP shows in Calgary. That's quite a fur piece.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|