473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Determining a user's (general) location?

I'm trying to determine the best way to figure out a user's location without asking them. It doesn't have to be wildly specific, and I'm sure it couldn't be anyways. But I have seen some kinds of "locative" functions on other websites from time to time (i.e. they know I'm getting on from wherever, Louisana and throw up an ad saying "vote for this mayor", or "Meet Singles in New Orleans", etc.)

What's the best way to figure out that information, (IP analysis? cookies? et al) and is there pre-existing code or a function out there to do it?

Thanks a LOT guys!

-M
Dec 2 '08 #1
3 1597
iam_clint
1,208 Expert 1GB
Get a database that lets you go from ip to location. then use server side programming to locate the ip connecting to it.
Dec 2 '08 #2
pronerd
392 Expert 256MB
This can not be done with JavaScript you will need server side code to do it. As has already been stated you will need to pull the information from one of the services that provides the location based on the user's IP address.

Be aware that these services are wildly inaccurate. The location information is based on where the IPs are registered, not their actual location. So for example even though I am actually in Kansas City, they frequently show me as in New York or California because that is where my ISP's offices are. Even if the IP location is correct it can not account for things like VPNs or other remote connections that can make it look like you are actually connecting from a different location.
Dec 2 '08 #3
rnd me
427 Expert 256MB
you can do it client side with the right webservices.

here's a way to get the IP: http://app.abcnews.go.com/video/getIP (oops)

there are a ton of geocoding jsonp webservices out there, so shop around.
you might also try simply searching google with the IP, you might find something. (you can search google from javascript using google search API)
Dec 2 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Dan | last post by:
I have an app that communicates over the Internet through API calls to the wininet DLL. I can determine whether IE has a proxy server configured (not the setting, just whether it uses a proxy...
3
by: James Marshall | last post by:
I need to detect the type of an object, more than just "object" as typeof gives us. I'm writing a general handler that accepts a variety of objects and properties, and acts accordingly depending...
7
by: Jean-David Beyer | last post by:
I have six hard drives (4 SCSI and 2 EIDE) on my main machine with parts of a database on each drive. The main index is on one SCSI drive all to itself. The main data are on the other three SCSI...
1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
0
by: Mike | last post by:
Hi! I am programmatically converting Excel to PDF using Adobe PDF printer installed with Adobe Acrobat 6 and above. When I initiate Print command for this printer, a window comes up which...
10
by: Peter Olcott | last post by:
Someone told me that determining the exact location and current state of any JavaScript controls is pretty easy. Does anyone know exactly how this is done?
1
by: euroluxantiques | last post by:
Hi All, Using VB.Net with SQL Server. I have a form that I create a number of Picture Boxes on dynamically, based on a stored procedure that retrieves a listing of images available for a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.