Changing webpage layout based on ip-address detected?

Discussion in 'Programming' started by jshi21, Feb 27, 2010.

  1. #1
    I've seen websites use my IP-address to detect what location I'm in and display my city on a portion of their webpage. Is there a way to use the IP-address, detect where the user is at, and then change the whole webpage design based on the users location?

    For example, I if someone is looking at my webpage in CA, I want it to look differently compared to the guy who looks at it from NY.

    Anyone know if this can be done? and what is this ability technically called?
     
    jshi21, Feb 27, 2010 IP
  2. NeoCambell

    NeoCambell Peon

    Messages:
    456
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
  3. patrick24601

    patrick24601 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    patrick24601, Feb 28, 2010 IP
  4. Mike-XS

    Mike-XS Greenhorn

    Messages:
    28
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    13
    #4
    It's a cloaking technique, to deliver different site content based on things like an IP address, useragent or referer. What you want to do I'd call Geo Targeted IP delivery, many sites, even Google use geo targeting for localisation purposes similar to what you have in mind.

    http://stroseo.com/navigation/geo-targeting-with-ip-delivery/
    http://en.wikipedia.org/wiki/Cloaking
    http://en.wikipedia.org/wiki/Geo_targeting

    A great guide to using the maxmind db:
    http://programmerdot.com/17/maxmind-geoip-php.htm

    I've seen a few PHP/Perl scripts around which can give you a head start like this:
    http://www.seoegghead.com/blog/seo/simple-geotarget-php-library-p61.html
    http://hamletbatista.com/2007/06/26/legitimate-cloaking-real-world-example-and-php-source-code/
    http://webnet77.com/scripts/geo-ip/country-redirect-script.html

    or you could try something like this:
    http://sourceforge.net/projects/l-redirector/
    http://de77.com/php/how-to-detect-users-countrylanguage-the-simple-way
     
    Last edited: Mar 3, 2010
    Mike-XS, Mar 3, 2010 IP