header() DOES NOT end the execution of a script.
However, many browsers, when they recieve a header ("Location: ") redirect, they cut the connection and just go to the redirected page.
You'll see if you do soemthing like:
header ("Content-type: text/plain");
...the script keeps on exeucting, outputing stuf as plain text instead of HTML ( assuming your browser cooperates, IE doesnt often, stupid M$ )
As a matter of fact, headers are the FIRST thing that a browser gets, much less the last, as it would be if script exeucting stopped after headers were sent.
If you want the script to end after a call to header(), put an exit(); right after the header(); call.