title: php maxmind geoip exception ip
body: <p>I'm using the Maxmid geoip script (php) to redirect users based on their location (www.mysite.com - for the purposes of this question). uk visitors will go to the uk site, whereas others will stay on the current site. however, i also want to set up an exception, just for my ip so that i am able to view both sites (provided my ip matches up with that given in the file - i am based in the UK). below is my coding which doesn't work with regard to the "exception ip".</p>
  
  <pre><code>&lt;?php
  require_once($_SERVER['DOCUMENT_ROOT']."/geoip/geoip.inc");
  $gi = geoip_open($_SERVER['DOCUMENT_ROOT']."/geoip/GeoIP.dat", GEOIP_MEMORY_CACHE);
  $country = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
  geoip_close($gi);
  $useragent_country = array('gb');
  $exception_ip = "80.47.200.21";
  
  if (in_array(strtolower($country), $useragent_country)){
      header('location: http://www.mysite.co.uk');
      exit();
  } 
  if ($_SERVER['REMOTE_ADDR'] = $exception_ip){
      header('location: http://www.mysite.com');
  }
  ?&gt;
  </code></pre>
  
  <p>furthermore, to keep the "exception ip" on the current site, is my coding correct?</p>