this error occurs if you already send information to the browser, e.g.
<?php
// This would generate an error
print "SENDING SOMETHING TO THE WEBPAGE";
header("location: apage.php");
exit();
?>
<?php
// This won't generate an error
header("location: apage.php");
exit();
?>
Hope this helps!