duanpo7282 2011-12-18 15:16
浏览 24
已采纳

文件上传后“标题已发送”错误[重复]

This question already has an answer here:

After I uploaded my files this kind of error is occurred. But there is no any errors in my localhost. What kind of error is this? How to fix this?

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/lahiruca/public_html/events/includes/links.php:1) in /home/lahiruca/public_html/events/includes/header.php on line 1

(from the comments)

<?php session_start();?> 
<div class="header"> 
<div class="logo"></div> 
<div class="right_header"> 
<div class="top_right_header"> 
  <ul> <?php if(isset($_SESSION['userid'])){ ?> 
</div>
  • 写回答

1条回答 默认 最新

  • dongqu3623 2011-12-18 15:22
    关注

    As the error says: You are trying to send headers (using the function session_start), but headers are allready sent.

    Ways headers can be sent:

    • output is generated: this can be intended, like you allready did an echo,
    • or unintended (most of the times there can be some sort of whitespace in front of you <?php code. Or after a closing ?> in an included file
    • the header function
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 iOS开发关于快捷指令截屏后如何将截屏(或从截屏中提取出的文本)回传给本应用并打开指定页面
  • ¥15 unity连接Sqlserver
  • ¥15 图中这种约束条件lingo该怎么表示出来
  • ¥15 VSCode里的Prettier如何实现等式赋值后的对齐效果?
  • ¥15 流式socket文件传输答疑
  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式
  • ¥50 关于多次提交POST数据后,无法获取到POST数据参数的问题
  • ¥15 win10,这种情况怎么办
  • ¥15 如何在配置使用Prettier的VSCode中通过Better Align插件来对齐等式?(相关搜索:格式化)
  • ¥100 在连接内网VPN时,如何同时保持互联网连接