PHP Sessions: HEaders Already Sent Solution
Wednesday, December 24th, 2003One for the PHP peeps:
If your using sessions and keep getting an error about how the headers cannot be sent because they have already been sent this usually occurs because the session_start() function was called after you started printing to the user’s browser (i.e. a print / echo call or straight HTML). Simply make <? session_start(); ?> as the first thing in your code (i.e. the very first line) and it’s all good.