Ti consiglio di leggere questo articolo:

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