Answer the question
In order to leave comments, you need to log in
How to solve problem with UTF8 With BOM and header()?
Hello dear toasters. The other day I ran into this problem.
To simplify, I wrote the following code
<?PHP
session_start();
if (isset($_SESSION["login"]))
echo "Добро пожаловать .$_SESSION["login"];
else {
header("location: panel.html");
}
?>
R”RѕR±СЂРѕ RїRѕR¶R°R”RѕРІР°С‚СЊ уважаемый
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at O:\home\test1.ru\www\admin.php:1) in O:\home\test1 .ru\www\admin.php on line 2
R”RѕR±СЂРѕ RїRѕR¶R°R”RѕРІР°С‚СЊ уважаемый
Warning: Cannot modify header information - headers already sent by (output started at O:\home\test1.ru\www\panel.php:1) in O:\home\test1.ru\www\panel.php on line 21
Answer the question
In order to leave comments, you need to log in
1) Always store/output everything in UTF-8 only (this includes files with code, database entries, etc.)
2) Never use BOM anywhere - this is a crooked thing that WILL create a lot of trouble for you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question