Hi I use a script that i need to change it's language and so i must change page charset of language.php file to utf-8. After this , my script dont work completly and in some page error. error is : cannot modify header information , it modified by language.php before!!!! what is problem?
I imagine you are doing header("Location: /index.php"); in a different file and language.php is included in this file and language echos the charset. You are not allowed to echo before calling header().
Turn on output buffering. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer so you will not receive "cannot modify header information" error. use ob_start(); as the first line of your code and ob_end_flush(); should be last line of code in the script. you may need to change header and footer files for doing this.
The error occurs because data has been sent (therefore, the header has also been sent) and you're trying to edit the header. Make sure whatever line causes the error is before any other line that creates output.
Headers come before a content. if you turn off buffering and do a Write anything, its too late to change a header because they have already been sent to the client. and you can also use javaScript <script language='javaScript'> window.location='index.php'; </script>
use javaScript code to redirect the page if you don't want to put the header at the top <script language='javaScript'> window.location='index.php'; </script>