Friday, 13 May 2016

php - Codeigniter: Message: Cannot modify header error



This type of question is already asked before



Codeigniter: headers already sent error



CodeIgniter headers already sent error with different Server



Codeigniter - Cannot modify header information - headers already sent by




Codeigniter: Message: Cannot modify header information - headers already sent by (output started at



http://ellislab.com/forums/viewthread/69280/#468283



Codeigniter: Message: Cannot modify header information - headers already sent by (output started at



Exact Error I am Getting



Severity: Warning


Message: Cannot modify header information - headers already sent by (output started at /home2/hanomart/public_html/ClickMyStay/application/controllers/welcome.php:472)

Filename: libraries/Session.php

Line Number: 675


What i am doing at welcome.php:472 Line




I am changing a session value like as below



$value="Some Value";
$session_data=array("hotel_search_value" => $value);
$this->session->set_userdata($session_data);


I have tried in below ways.





  1. Checked White spaces before (Everything is fine.No white spaces).

  2. Changed $_SERVER['REMOTE_ADDR'] to $this->server('remote_addr') in line system/core/Input.php Line no 351



But those things didnt solve my problem.



Can anyone help me out in this issue.



Thanks in advance,




Sree ram


Answer



Turn off all echo()ing and var_dump()ing before line 472.



Headers are sent whenever is something echo()ed out so session library can not modify sessions in that point and it triggers error.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...