I am using header("Lcoation:index.php") to redirect to index page but i am getting error there that header already sent. How can I fix it?
header("Location:index.php"); common cause for this error is remove echo or print statments before it dont write anything on client side before this statement Regards Alex
kmap, may be you mean server side, not client. Because client side is the browser. seotraining, if you cant find where you start the output to the browser you can user ob_start() function. Put it at the very first line of the script - right after <?
Also, if you have any "white space" at the bottom of your file, it will cause this error when trying to modify headers. Make sure there are not lines or even a space after your last characters of of code (meaning: ?> or </body>)
That is true only if the file in which have space is included before Header() function. Otherwise if the space is AFTER the Header() it does not matter and it isn't problem!
Right, I failed to mention it could be in any included files too. That error can be a headache to debug.
There has to be something being printed or echoed before the header function if you got that error. You need to remove it.