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条)

报告相同问题?

悬赏问题

  • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?
  • ¥30 数字电源对DSP芯片的具体要求
  • ¥20 antv g6 折线边如何变为钝角
  • ¥30 如何在Matlab或Python中 设置饼图的高度
  • ¥15 nginx中的CORS策略应该如何配置
  • ¥30 信号与系统实验:采样定理分析
  • ¥100 我想找人帮我写Python 的股票分析代码,有意请加mathtao
  • ¥20 Vite 打包的 Vue3 组件库,图标无法显示
  • ¥15 php 同步电商平台多个店铺增量订单和订单状态
  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别