Cannot modify header information - headers already sent by ?

ccycyy 2010-11-25 08:01:00
Warning: Cannot modify header information - headers already sent by (output started at F:\wwwphp2\systerm\index.php:11) in F:\wwwphp2\systerm\cookiesession.php on line 9
failed

我的 index, 使用top,body,bottom 引入的

在body,里include cookiesession.php页面来读cookie值

这个意思是说不能接连引用还是?。。
...全文
94 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiliangliang 2010-12-12
  • 打赏
  • 举报
回复
[Quote=引用楼主 ccycyy 的回复:]
Warning: Cannot modify header information - headers already sent by (output started at F:\wwwphp2\systerm\index.php:11) in F:\wwwphp2\systerm\cookiesession.php on line 9
failed

我的 index, 使用top,bo……
[/Quote]

setcookie 前不能有输入输出,这是一种安全性的考虑,小朋友,要加油哦,哥哥看好你哦
igaojie 2010-11-25
  • 打赏
  • 举报
回复
楼上正解!
heyli 2010-11-25
  • 打赏
  • 举报
回复
说头部已经发送
如果你的文件是utf-8编码 确保是无bom头的
session_start(); setcookie(); 这一些放在页面就开始处 前面不要任何输出
LuciferStar 2010-11-25
  • 打赏
  • 举报
回复
cookie,header前,都不能有数据输出。否则就会出现这个问题。
另外,如果程序是UTF-8的,还要检测服务器的配置,有可能出现BOM问题。

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧