Jump to content


Detecting user's city

  • Please log in to reply
3 replies to this topic

#1 Daniel0

  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 02 October 2006 - 04:50 PM

I've noticed advertisments and popup windows saying stuff like "bla bla in X" (where X is the city I live in). How do people detect what city I live in ???

#2 redbullmarky

  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 02 October 2006 - 06:24 PM

generally its down to your IP address and a huge database of IP's containing information about their location. It's not wildly accurate, as it only gives the city of your ISP (i.e, the people to whom the IP address has been allocated). I saw a site once that worked pretty well, and partially relied on users saying whether the location specified was correct or not, and if not offering an alternative. cant remember the link, though. But ultimately that relied on the same system
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 Daniel0

  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 02 October 2006 - 06:37 PM

I've tried that an advertisement said something about a specific part of the city (where I lived) which would as small as 5 square kilometers. I am just wondering how close they can get, and how the f*** they do it.

#4 obsidian

  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 02 October 2006 - 06:43 PM

check out something like this whois script for about the best results
You can't win, you can't lose, you can't break even... you can't even get out of the game.

while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users