shakeit Posted March 4, 2008 Share Posted March 4, 2008 Hello, I am getting this error at several places: headers already sent (output started at ......) I think it is a common error, so sorry for asking such a "stupid" question... Does a common rule exist for avvioding these errors? Thank you all... Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted March 4, 2008 Share Posted March 4, 2008 That happens when you try to set headers after something has already been output to the browser. You can change the Error reporting to hide this error. Quote Link to comment Share on other sites More sharing options...
shakeit Posted March 4, 2008 Author Share Posted March 4, 2008 No it doesnt make the "redirect" to the wanted page then ... the same with cookies, t wont save the information in the cookies... Quote Link to comment Share on other sites More sharing options...
discomatt Posted March 4, 2008 Share Posted March 4, 2008 You have to make all header() and cookie() calls before anything is outputted to the browser. Quote Link to comment Share on other sites More sharing options...
shakeit Posted March 4, 2008 Author Share Posted March 4, 2008 What do you mean before its outputted? Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted March 4, 2008 Share Posted March 4, 2008 Why don't you post some of your code so we can see what your doing and whats going on? Quote Link to comment Share on other sites More sharing options...
discomatt Posted March 4, 2008 Share Posted March 4, 2008 Output is anything visible in the browser (ex: anything you can see when you view source in the browser). This can be html, echo() calls, print() calls, ect. Your best bet is to check out the output buffer functions.. and use a buffer to catch anything that would be outputted, and flush it to the browser at the end of the script http://ca.php.net/manual/en/ref.outcontrol.php Quote Link to comment Share on other sites More sharing options...
shakeit Posted March 4, 2008 Author Share Posted March 4, 2008 Why don't you post some of your code so we can see what your doing and whats going on? Yeah I would but there are so many places I get this error, hehe... anywayz I tried this solution by putting header an session_start() before anything else, and it works.. But what if I want to use header() in the middle of a html page :-S Thats the issue, but i get the idea... thanx... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.