Possible Duplicate:
php - Should I call exit() after calling Location: header?
I dont know how to title this question but here it goes.
what is the difference between the two code snippets below:
script1 - without exit()
:
if($var = true){
header('Location: anotherpage.php');
}
script2 - with exit()
:
if($var = true){
header('Location: anotherpage.php');
exit();
}
from what I understand, header()
exits the current page and jumps to another page if the condition is true therefore having exit()
after header()
is pointless - am I right?