You are needed to be sure that you put header exactly after <?php in your code there are no any else including empty space after ?> ..
If you're already sure, the problem must be in your editor, some editors have bugs whereas they conceal header containing array sent before the first <?php in your code.. Copy your code in simpler editor such as notepad, or ultra edit and save it with different name , then replace the link name in another your php page pointed to the code by using new name.. It must be success ..