doufei2194 2014-10-16 18:59
浏览 19

Ob_start和重定向标题[重复]

This question already has an answer here:

This is not new topic, as everyone developer face problem usually redirecting to a link with this error

"Warning: Cannot modify header information "

i read different solutions for this problem using ob_start, but i was unable to understand the process. can somebody please explain with necessary detail and help me to understand why we face this problem and how it can be resolved. i am developing wordpress plugin and i am facing this problem in redirecting.

Regards

</div>
  • 写回答

1条回答 默认 最新

  • doujinyi1267 2014-10-16 19:05
    关注

    By calling ob_start(), you are telling PHP to start output buffering. This basically means, when you try output stuff using commands like echo etc. PHP will temporarily save/buffer this output. Header must be sent before the output, so since you're not actually sending the output to the browser, you can still modify the headers even after you have used commands such as echo. When you are ready to send your output back to the user's browser you can use something like ob_end_flush.

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?