CodeIgniter Forums
Cannot modify header - AJAX - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Cannot modify header - AJAX (/showthread.php?tid=30791)



Cannot modify header - AJAX - El Forum - 05-26-2010

[eluser]geogis[/eluser]
Hello,

Having a problem with cookie..

I am using AJAX to run some php script that sets cookie and display a "cart" on the screen. Getting error:

Quote:A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /customers/khushimat.pl/khushimat.pl/httpd.www/system/application/controllers/ajax.php:1)

Filename: helpers/cookie_helper.php

Line Number: 92

I tried to find whitespaces and any output. Also saved the file in different editor to make sure there are is no BOM problem. Have updated cookie_helper.php file with a fresh clean copy to make sure there were now changes made. And nothing...

Any help please?


Cannot modify header - AJAX - El Forum - 05-26-2010

[eluser]_kailash[/eluser]
As it says that the output started at line 1 I would double check /customers/khushimat.pl/khushimat.pl/httpd.www/system/application/controllers/ajax.php:1 for whitespace before the <?php tag

If you still can't find it you should try something like firebug to look at the http traffic and see what exactly CI is sending to your browser


Cannot modify header - AJAX - El Forum - 05-26-2010

[eluser]geogis[/eluser]
Hmm... actually I just manage to fix the problem using one of the previous version of the file..... but still do not know what was the problem.

Where would I look for it in fireBug?


Cannot modify header - AJAX - El Forum - 05-26-2010

[eluser]_kailash[/eluser]
In the "net" tab you can examine any request made by your browser; you can look in the request response to search for strange output before the html.
I'm telling you this because I had the same problem and while looking at the response I noticed that there was a whitespace before the <!DOCTYPE tag


Cannot modify header - AJAX - El Forum - 05-26-2010

[eluser]geogis[/eluser]
Great! thanks for responce!