title: Warning: Cannot modify header information
body: <p><em><strong>I get this error:</em></strong> Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/recover.php:11) in /Applications/XAMPP/xamppfiles/htdocs/recover.php on line 22</p>
  
  <p>This is my code so that you can take a look: </p>
  
  <pre><code>&lt;?php
  
  include 'core/init.php';
  logged_in_redirect();
  
  ?&gt;
  
  
  &lt;h1&gt; Recover &lt;/h1&gt;
  
  &lt;?php
  if (isset($_GET['success']) === true &amp;&amp; empty($_GET['success']) === true) {
  ?&gt;
      &lt;p&gt;thanks we have emailed you&lt;/p&gt;
  &lt;?php
  } else {
      $mode_allowed = array('username', 'password');
          if(isset($_GET['mode']) === true &amp;&amp; in_array($_GET['mode'], $mode_allowed) === true) {
              if(isset($_POST['email']) === true &amp;&amp; empty($_POST['email']) === false){
                  if (email_exists($_POST['email']) === true) {
                      recover($_GET['mode'], $_POST['email']);
                      header('Location: recover.php?success');
                      exit();
                  } else {
                      echo 'we cant find that email in our database';
                  }
              }
  
  ?&gt;
      &lt;form action="" method="post"&gt;
          Please enter your email adress:&lt;br&gt;
          &lt;input type="text" name="email"&gt;&lt;br&gt;
          &lt;input type="submit" value="Recover!"&gt;
  
  
      &lt;/form&gt;
  
  &lt;?php
      } else {
          header('Location: index.php');
          exit();
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p><em><strong>ANY IDEA ON HOW CAN I FIX THIS? 
  Thanks in advance</em></strong></p>