Cannot modify header information |
[eluser]Nathan Payne[/eluser]
http://www.haunted-houses.net/admin I am getting the following error: Quote:A PHP Error was encountered This happens when I try to access the admin section of my sites. I have attached the code for my admin section below. Controller: Code: <?php Model: Code: <?php View: Code: <div id="content"> Also when I submit the form I get the following: Quote:Severity: Warning
[eluser]Armchair Samurai[/eluser]
Perhaps this is far too obvious a question, but what's on line 37 in Layout.php? From the errors, sounds like it's outputting something to the browser.
[eluser]Nathan Payne[/eluser]
[quote author="Armchair Samurai" date="1227253725"]Perhaps this is far too obvious a question, but what's on line 37 in Layout.php? From the errors, sounds like it's outputting something to the browser.[/quote] Layout.php is below. I have hunted the files for blank space etc. Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
[eluser]Bogdan Tanase[/eluser]
if this line executes before redirect, then it won't work, because it will output headers to the browsers. Code: $this->obj->load->view($this->layout, $loadedData, false);
[eluser]Berserk[/eluser]
-change your output_buffering = ON -check your file encode (i encoded in UTF-8 and get the same problem)
[eluser]Armchair Samurai[/eluser]
Berserk has an excellent point - if you've encoded in UTF-8, there might be the invisible BOM mark at the beginning of your files which needs to be removed (easy enough, depending on your text editor) otherwise you will get the "Cannot modify header information" error. Also, unrelated to the problem at hand, you've failed to load the model admin_model in your controller function verify where you actually need to access it, as opposed to index where it's loaded but not used.
[eluser]Nathan Payne[/eluser]
How do I change output_buffering = ON? What text editor is best for too see the BOM marks? Thanks.
[eluser]Berserk[/eluser]
sorry i forgot, let's find in php.ini, also you must have permission to edit. I'm using Notepad++ with "Encode in UTF-8 without BOM" Mode. If you're encoding your controller file in UTF-8, please convert to ANSI or UTF-8 without BOM ( at Notepad++'s Format Option). |
Welcome Guest, Not a member yet? Register Sign In |