doushou5761 2018-12-06 06:56
浏览 45
已采纳

警告:无法修改标题信息:[重复]

This question already has an answer here:

I try to use ob_start() ob_end_flush(); to hide the errors. Is there no other way to fix this Cannot modify header information?

echo $claim_url;
require_once $_SERVER['DOCUMENT_ROOT'] . '/auto-faucet/lib/shortlink.php';
$claim_url = shortlink_create($claim_url);
header('Location: ' . $claim_url, true, 303);
</div>
  • 写回答

1条回答 默认 最新

  • dqfsbvd43312 2018-12-06 06:57
    关注

    Before header there should not be anything in the output.

    Remove echo $claim_url;

    Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.

    Documentation

    NOTE: use die() or exit() after redirect.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错