title: headers already sent issue
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8028957/warning-headers-already-sent-in-php">“Warning: Headers already sent” in PHP</a>  </p>
  </blockquote>
  
  
  
  <p>Looking at the other threads relating to this error I can't seem to locate my issue.  I don't have any output prior to the call so can anyone tell me what the issue is?</p>
  
  <p>Error is:</p>
  
  <pre><code>Warning: Cannot modify header information - headers already sent by ... line 12
  </code></pre>
  
  <p>Here is the PHP code:</p>
  
  <pre><code>&lt;?php if (!isset($_SESSION)) session_start();
  
  require_once 'classes/mobile_detect.class.php';
  
  $detect = new Mobile_Detect;
  if ($detect-&gt;isMobile()) {
      $referer = 'http://my_site_name/m/index.php';
  
      header("Location: " . $referer);
      exit();
  }     
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  ...
  </code></pre>