School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,511 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,935 people online right now. Registration is fast and FREE... Join Now!




Geolocation through IPs

 

Geolocation through IPs, A flash file that tracks global accessing of my site

grimpirate

11 Apr, 2007 - 07:17 PM
Post #1

D.I.C Regular
Group Icon

Joined: 3 Aug, 2006
Posts: 383



Thanked: 16 times
Dream Kudos: 375
My Contributions
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.

User is offlineProfile CardPM
+Quote Post


skyhawk133

RE: Geolocation Through IPs

11 Apr, 2007 - 07:23 PM
Post #2

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,844



Thanked: 152 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
I actually own the IP2Location database, used to use it for targetting jobs. I think I paid like $300 for it.
User is offlineProfile CardPM
+Quote Post

snoj

RE: Geolocation Through IPs

11 Apr, 2007 - 07:28 PM
Post #3

Now with 10% more nom!
Group Icon

Joined: 31 Mar, 2003
Posts: 3,369



Thanked: 29 times
Dream Kudos: 775
My Contributions
So....why is this in Flash & Actionscript instead of PHP?
User is offlineProfile CardPM
+Quote Post

grimpirate

RE: Geolocation Through IPs

11 Apr, 2007 - 07:41 PM
Post #4

D.I.C Regular
Group Icon

Joined: 3 Aug, 2006
Posts: 383



Thanked: 16 times
Dream Kudos: 375
My Contributions
The end product is in flash. PHP parses, but Flash renders the data. I imagine it could fall into either one of the forums. blink.gif
User is offlineProfile CardPM
+Quote Post

snoj

RE: Geolocation Through IPs

11 Apr, 2007 - 07:50 PM
Post #5

Now with 10% more nom!
Group Icon

Joined: 31 Mar, 2003
Posts: 3,369



Thanked: 29 times
Dream Kudos: 775
My Contributions
Well you didn't link to the flash, so I was wondering.
User is offlineProfile CardPM
+Quote Post

pioSko

RE: Geolocation Through IPs

12 Apr, 2007 - 08:34 AM
Post #6

still.dreaming
Group Icon

Joined: 6 Jun, 2003
Posts: 1,888



Thanked: 14 times
Dream Kudos: 225
My Contributions
http://www.maxmind.com/

There is/was a free service which let you download a database of IP's and their location... PHP.net used to use it, but I think they use something else now.

Once you have that installed/working you just send the variable values to Flash using LoadVars and sendAndLoad().
User is offlineProfile CardPM
+Quote Post

grimpirate

RE: Geolocation Through IPs

12 Apr, 2007 - 09:49 AM
Post #7

D.I.C Regular
Group Icon

Joined: 3 Aug, 2006
Posts: 383



Thanked: 16 times
Dream Kudos: 375
My Contributions
Yeah I looked at that but the database files are rather large, like 19MB or so is the country one, and the city one is significantly more I believe. Not to mention that the free versions weren't as accurate as the paid versions, there's some discrepancy there. I had already considered those things before I went with what I'm currently doing. More importantly my free server space is limited. It's just a shame I can't access beyond the scope of my URL. ::shrugs:: live and learn. I could likely employ javascript to that end, but I don't like to code with javascript on my pages. I like visitors to be able to surf onto my site with full confidence that if they disable javascript it will still work. My flash app uses LoadVars and it accesses a database which I create. It's just I have to create the database by hand. I don't mean literally opening a text editor, but by running another script on my local computer.
User is offlineProfile CardPM
+Quote Post

jfdonohoe

RE: Geolocation Through IPs

27 May, 2009 - 11:36 AM
Post #8

New D.I.C Head
*

Joined: 27 May, 2009
Posts: 1

QUOTE(skyhawk133 @ 11 Apr, 2007 - 07:23 PM) *

I actually own the IP2Location database, used to use it for targetting jobs. I think I paid like $300 for it.


Skyhawk,

I saw your other thread about testing the IP2Location data base and I was wondering how accurate it is within the USA.

I have a client who is interested in geolocation by IP functionality but only if there is a very high probability of accuracy for the end user(like over 90%). I know that IP2Location claims a 99.9% accurate database but I don't know if that translates into a 99.9% accurate user experience.

We're not looking to specify down to the city/zip area which can be inaccurate due to the local ISP location. We're looking to more of a Metro area or State location.

Out of your personal testing did you come across any documentation/statistics that can help ease the "anxiety of inaccuracy"?

Thanks!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 05:14AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month