Life, SAP, Consulting, Programming, Coding, ASP.NET, Sharepoint, MVC, Javascript, PHP, WebDesign, CSS, HTML

Posts tagged ‘Cannot modify header information’

Cannot modify header information

Cannot modify header information – CAKEPHP

I recently try CAKEPHP platform. Soon, I encountered with many problem. But after that, I have fixed them all, and learned new experiences.

Cannot modify header information

This error occurred when I tried to apply login validation on my server. XXXController requires logged-in user. Each controller went well. Except that when users not logged in, XXX will redirect to Users/login. This is point I got my erro. I tried some search. There are many people had encountered the same error. Almost guru say that It was dued to WHITESPACE out side of <?php ?> tag. I had checked many time my controllers. No WHITESPACE. I cleared my controller. Rewrote them. No use. Finally, I noted that I used HTML comment <!–comment –> out side of the <?php ?> tag. I had removed these comment. Aha. They are not truly WHITESPACE, but they gave madness. Hope this post will help some new dummy like me.