duanqilupinf67040 2013-01-31 12:43
浏览 13

Cookie创建错误[重复]

Possible Duplicate:
Headers already sent by PHP

I got headers alreayd sent errors on my wordpress theme's home page. My functions like ;

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'];
    }

}

This functions wordks perfectly on my local but i didint understand whats wrong with hostgator ?

When i called my functions;

<?php 
 LoopCokiee();
 LoopCokieeUpdate();
echo '<!--LoopResults--'.LoopCokiee().'//'.LoopCokieeUpdate().'-->'
?>

This errors apper ;

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

What should i do ? Any helps thanks.

  • 写回答

2条回答 默认 最新

  • dtslobe4694 2013-01-31 12:51
    关注

    before sending headers do not use any output

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100