duannan4486 2010-07-28 16:06
浏览 24
已采纳

警告:无法修改标头信息。 找不到错误[重复]

This question already has an answer here:

I'm using a login-script and on my developmachine it worked perfectly but when I moved it to my webhost it stopped working.

The code can be viewed here: http://beta.yapaste.com/fm

The error I get when I login is

Warning: Cannot modify header information - headers already sent by (output started at /*/*/*/*/*/*/login.php:10) in /*/*/*/*/*/*/inc/login.php on line 43

But I can't find the error.

Thanks for answers, Victor.

Edit: Found the error, I included the file that I've got on yapaste in another file so the php-code wasent first.

</div>
  • 写回答

2条回答 默认 最新

  • dqq9695 2010-07-28 16:11
    关注

    On line 10 of login.php something is sent to the browser (white space between ?> and <?PHP tags count), at which point headers must be sent to. This triggers a warning when you try to then add more headers after this, on line 43.

    You need to have a look at line 10 and prevent the output being sent, or use output buffering - your previous host could have had this on by default which might explain why it no longer works...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料