Block parts of your site (specifically ads) from certain countries.

Discussion in 'PHP' started by MediaHustler, Jan 6, 2007.

  1. #1
    Hello I am curious if it is possible to have a little php code where I can block all NON-US traffic from seeing my Yahoo ads and replace the ads with Google Ads.

    So NON-US (sees) Google Ads
    and US (sees) Yahoo Ads.

    I would ask my insanely smart bud krakjoe, but he is away at the moment.
     
    MediaHustler, Jan 6, 2007 IP
  2. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #2
    Yes, it's possible, you would need a GeoTargeted database that would match up the host of the visitor and compare it to the table. You may want to involve caching with it because it can be CPU intensive to comparing on every hit.

    That's how you would do it though. I don't know the specific PHP code to do it, but I'm sure someone here does.

    It costs $50, but this would do it: http://www.analysespider.com/ip2country/ip_country.html

    You are looking for something like this.
     
    fsmedia, Jan 6, 2007 IP