title: will PHP header() & exit() securely terminate a script before redirecting?
body: <p>Is the following a secure way of protecting a user only area?   </p>
  
  <pre><code>if(!isset($_SESSION['username'])){redirect(SITE_ROOT . 'st_pages/login/');}
  </code></pre>
  
  <p>using:</p>
  
  <pre><code>function redirect($url)
      {
          header('Location: ' . $url);
          exit('&lt;a href="' . $url . '"&gt;Redirecting you to: ' . $url . '&lt;/a&gt;');
      }
  </code></pre>