Results 1 to 2 of 2

Thread: How to auto detect user's location and redirect them to a page?

  1. #1
    Join Date
    Sep 2010
    Posts
    2

    How to auto detect user's location and redirect them to a page?

    Hi there, I'm new to web design/development I just joined webdevforums.com today!

    I'm building a classifieds site which has city-specific sections (e.g. city1.domain.com, city2.domain.com, etc).

    On the main page at domain.com I want to either:
    1. List the city-specific subdomains so that the user can choose one, and then I want to remember what they selected so that they next time they go to domain.com the site remembers and auto redirects them to the last city they picked.

    or

    2. Auto detect what city the user is in and send them to the corresponding subdomain (e.g. if they are in city1 then they'd be automatically redirected to city1.domain.com)

    Help?
    I'm using Wordpress MU if that is any help.

  2. #2
    Join Date
    Jul 2009
    Posts
    47
    You will have fun setting this up. theres a thing called geoip and its free. You can get it from maxmind.com
    it is a php script. it comes as "geoip.inc" and "geoip.dat" you change the geoip.inc into geoip.inc.php and then you spend alot of time trying to figure out how intergrate in in to a page.
    Great fun!!!!!!!!!!!!!!!!
    You will love it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •