可能重复:
PHP 已发送的标头
我的 wordpress 主题主页上的标题已经发送错误。我的功能像;
function LoopCokiee() {
if(isset($_COOKIE['PozCounter']))
{
setcookie("PozCounter", ++$_COOKIE['PozCounter'], time()+3600);
}
else
{
setcookie("PozCounter", 1, time()+3600);
}
return $_COOKIE['PozCounter'];
}
function LoopCokieeUpdate () {
$Kuki = $_COOKIE['PozCounter'];
$Topl = '20'; //wp_count_posts()->publish;
if ($Kuki > $Topl ) {
setcookie("PozCounter", 1, time()+3600);
} else {
return $_COOKIE['PozCounter'];
}
}
这在我的本地功能上非常完美,但我没有理解hostgator有什么问题?
当我调用我的函数时;
<?php
LoopCokiee();
LoopCokieeUpdate();
echo '<!--LoopResults--'.LoopCokiee().'//'.LoopCokieeUpdate().'-->'
?>
出现此错误;
Warning: Cannot modify header information - headers already sent by (output started at /home/igze/public_html/ddddd.com/wp-content/themes/smooth/home.php:1) in /home/igze/public_html/ddddd.com/wp-content/themes/smooth/PozHook/index.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/igze/public_html/ddddd.com/wp-content/themes/smooth/home.php:1) in /home/igze/public_html/ddddd.com/wp-content/themes/smooth/PozHook/index.php on line 11
我应该怎么办 ?任何帮助谢谢。