Reason:
Header already send error in PHP occurs when we print anything before redireding using header();
Solution:
- cut out your all code of <?php code here ?>
- paste above all content of that page.
- or you can put all content in else{} if step 2 not works.
use this think if above method not works : https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php/8028987#8028987