title: REMOTE ADDR Issue with Cron Job
body: <p>I need to get the IP of the visitor, but when the cron runs it finds that REMOTE ADDR is an undefined index. In fact there is no remote address when the file runs with the cron.</p>
  
  <p>How do I avoid this issue?</p>
  
  <p>Is there a way in PHP to say " if REMOTE ADDR exists then consider it, if not ( because it is running from the cron ) then bypass it" ??</p>
  
  <pre><code>$ip=$_SERVER['REMOTE_ADDR'];
  
  
  $allowed_ips = array("82.61.144.100", "82.64.144.100");
  
  if (!in_array($ip, $allowed_ips)) {
  header("Location: http://pitchmystuff.co.uk/coming_soon/");
  </code></pre>
  
  <p>}</p>