![]() |
header output and session error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: header output and session error (/showthread.php?tid=22554) |
header output and session error - El Forum - 09-13-2009 [eluser]mriso[/eluser] I´m trying to use SESSION library and URL helper, but always get HEADER ERROR A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at C:\Arquivos de programas\xampp\htdocs\ncomp\system\application\controllers\login.php:1) Filename: libraries/Session.php Line Number: 662 AND A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at C:\Arquivos de programas\xampp\htdocs\ncomp\system\application\controllers\login.php:1) Filename: libraries/Session.php Line Number: 662 I SINCERELY DONT KNOW WHY SINCE I DONT OUTPUTED ANYTHING <?php class Login extends Controller { function Login() { parent::Controller(); } function index() { $this->load->helper('url'); $this->load->library('session'); $this->load->model('Do_Login'); $query = $this->Do_Login->checkLogin(); $num_rows = $this->db->affected_rows($query); if($num_rows > 0){ $row = $query->row(); $newdata = array( 'user' => $row->nome, 'empresa' => $row->empresa, 'email' => $row->email, 'logged_in' => TRUE ); $this->session->set_userdata($newdata); }else{ $newdata = array( 'user' => 'failed', 'empresa' => 'failed', 'email' => 'failed', 'logged_in' => FALSE ); $this->session->set_userdata($newdata); } if($this->session->userdata('logged_in') == TRUE){ redirect('index.php/environment/'); # index.php/login/ }else{ redirect('index.php/welcome/'); #index.php/welcome/ } } } ?> header output and session error - El Forum - 09-13-2009 [eluser]mriso[/eluser] i also noted that two "dots" appears on the top of my page. I cant imagine WHERE they came from header output and session error - El Forum - 09-13-2009 [eluser]brianw1975[/eluser] check every file that gets loaded automatically, and any file you may have edited. like config.php, database.php, index.php header output and session error - El Forum - 09-13-2009 [eluser]mriso[/eluser] i checked! there is nothing being autoloaded, and on my files. The two dots only appears on google chrome, not in FF header output and session error - El Forum - 09-13-2009 [eluser]mriso[/eluser] my form is calling the controller i put above: action="index.php/login/" header output and session error - El Forum - 09-13-2009 [eluser]wiredesignz[/eluser] Check for whitespace outside of the <?php ... ?> tags in login.php. header output and session error - El Forum - 09-13-2009 [eluser]mriso[/eluser] i did... but still not working! header output and session error - El Forum - 09-13-2009 [eluser]mriso[/eluser] in fact, this error appears even if I autoload A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at C:\Arquivos de programas\xampp\htdocs\ncomp\system\application\controllers\welcome.php:1) Filename: libraries/Session.php Line Number: 662 in the welcome page header output and session error - El Forum - 09-13-2009 [eluser]mriso[/eluser] FOR GOD´S SAKE my documents were all with "BOM UTF-8 signature" so thats why were not working ... púff hours lost to this ... ;( now it is ok THX!!!! |