mysql - Can not modify header information, what is wrong with this php code -


this question has answer here:

i new programming, website else had built me has stopped working. trying find out be. did read explanations complicated me dont know enough programming.

warning: cannot modify header information - headers sent (output started @ /home/username/domain/index.php:3) in /home/username/domain/controllers/register.php on line 31

the code register.php

header("location: ".url."register-missing"); // line 31     exit();  }    header("location: ".url."register");     exit(); } 

the code index.php

<?php      class index extends controller { // line 3          function __construct() {             parent::__construct();         }          function index() {                   $this->view->render('index/index');         }     } ?> 

you'd have check if thing echoes or prints before header redirect called. it's practice handle header redirects @ beginning of page, before other logic executed. try avoid include files before header redirect


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -