Welcome Guest, Not a member yet? Register   Sign In
Cannot modify header - AJAX
#1

[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?
#2

[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
#3

[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?
#4

[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
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB