cannot modify header information - headers already sent
Hello everyone, I was creating a website of my own with php. Everything was alright at the beginning but after sometimes, I don't understand what's gone wrong with my codding. It shows [ headers already sent ] error. It says cannot [ modify header information ]. I really didn't understand what is wrong with my codding.
Dear friends if anyone knows what is going wrong with my codding, what is the meaning of [ headers already sent ] then please tell me.
It will help me a lot ... Thank you in advanced..
Error: header already sent ...
04-04-2018, Total 2 Ans
, 29 views
check_circle_outline BEST ANSWER
Suddenly after trying many times, I got the solution for this problem.
Friends the Error: [ headers already ] sent ... is showing on my browser because header() was not able to redirect. I don't know much that why this header() was not able to redirect but finally got the solution.
After putting ob_start(); at the top of the file, suddenly it starts working perfectly.
So friends if you also had this problem then on that file where [ header already sent ] error is showing.. just put ob_start(); at the top of that file.