Warning: Cannot modify header information - headers already sent by...

Problem

An error like Warning: Cannot modify header information - headers already sent by.... tells you that the script making the call to the function is doing something before it should!

Solution

You need to 3 the file with the function and make the function call before your script does anything else!

This error is caused when the script creates output like text, markup or plain white space before it sets any headers. Removing any whitespace and ensuring this function is called first will solve this.

http://php.net/manual/en/function.header.php

Close