Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2. require_once(”geoip/geoip.inc”);
  3. $gi = geoip_open(”geoip/GeoIP.dat”,GEOIP_STANDARD);
  4. $country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
  5. geoip_close($gi);
  6. if($country_code == ‘CS’)
  7. {
  8. header(’Location: http://www.example.net/1/’);
  9. }
  10. else
  11. {
  12. header(’Location: http://www.example.net/2/’);
  13. }
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement