Reputation: 558
So the problem is that I got a mistake - Cannot modify header information - headers already sent by.... There is a millions of solution on the website that told exactly what is the problem, and the question is not about it. But the problem that I don't get that mistake during test on my localhost, everything work fine without mistake, but as soon I upload the scrip on the server it gave me this mistake. So the question what is the diferent between server and localhost?
Upvotes: 1
Views: 109
Reputation: 4265
My best bet is that the error reporting level is different in php.ini
.
On your localhost you may have notices and warnings turned off, while they are enabled on the server.
In that case, an additional unwanted output will be produced, and this output generates the unwanted headers.
Upvotes: 0
Reputation: 98
There is actually little or no difference. It depends on the OS both are running on and configuration settings of both. Some rules are enforced on linux which are not enforced on windows for example. The best is to try to understand the OS so you'll be able to configure them very well.
Upvotes: 0
Reputation: 512
open your file with text editor like notepad++, then from encoding tab choose "UTF8 without BOM" then your code should work.BOM character is a character that you cant see but will be sent to header and and cause your this problem.
Upvotes: 1