what is the difference between having exit() and having not in a header function?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3553698/php-should-i-call-exit-after-calling-location-header">php - Should I call exit() after calling Location: header?</a>  </p>
</blockquote>



<p>I dont know how to title this question but here it goes.</p>

<p>what is the difference between the two code snippets below:</p>

<p>script1 - without <code>exit()</code>:</p>

<pre><code>if($var = true){
header('Location: anotherpage.php');
}
</code></pre>

<p>script2 - with <code>exit()</code>:</p>

<pre><code>if($var = true){
header('Location: anotherpage.php');
exit();
}
</code></pre>

<p>from what I understand, <code>header()</code> exits the current page and jumps to another page if the condition is true therefore having <code>exit()</code> after <code>header()</code> is pointless - am I right?</p>
