1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Detecting country

Discussion in 'Programming' started by macdesign, Nov 25, 2005.

  1. #1
    I want to put something in a PHP script that will tell if a viewer is from Canada or the US or some other country?

    I need to put some Amazon links on a site, and want to customize it to go to the correct Amazon site for the country.

    I'm looking for a solution that is recommended

    I found, for example this one http://ip-to-country.webhosting.info/node/view/6 - which requires downloading a reference file.
     
    macdesign, Nov 25, 2005 IP
  2. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #2
    Use Phpadsnew, there's a function on there to display certain adverts via the IP address and/or Country type..I use it on my sites. hope this helps.
     
    misohoni, Nov 25, 2005 IP
    mitchandre likes this.
  3. macdesign

    macdesign Peon

    Messages:
    568
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, that might help, since I already have it installed, but have not had time to play with it and find all the features. I have it running on two of my sites, but since I installed in in a shared location, I can easily add it to this site.

    However a quick look - it seems you have to buy access to IP2Country Database - which is $50+$170 per year
     
    macdesign, Nov 26, 2005 IP
  4. JSellnau_TSCC

    JSellnau_TSCC Peon

    Messages:
    166
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I believe you can also use the GeoIP database with that, and they have a basic one that is free.
     
    JSellnau_TSCC, Dec 7, 2005 IP