Guest User

Untitled

a guest
Jul 20th, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. How can I set free geo targeting ads/banners?
  2. <?php
  3. require_once("geoip.inc");
  4.  
  5. $gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);
  6.  
  7. $country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
  8. geoip_close($gi);
  9.  
  10. if($country_code == 'US')
  11. {
  12. echo 'usa';
  13. } else {
  14. echo 'world';
  15. }
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment