【问题标题】:phpdesktop-chrome - Not Working for Header in phpphpdesktop-chrome - 不适用于 php 中的标头
【发布时间】:2019-08-09 10:23:12
【问题描述】:

我有一个 PHP 文件,每当在 PHP phpdesktop-chrome (APP) 中运行一个文件时,我都在下面,我的文件中只有以下代码。

header("Content-Type: application/xls");
header("Content-Disposition: attachment; filename=filename.xls");
header("Pragma: no-cache");
header("Expires: 0");

以下是我的错误代码。

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:2)
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:3)
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:4)
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:5)

【问题讨论】:

标签: php phpdesktop


【解决方案1】:

尝试在第一个<?php 开始标记之后插入ob_start();

【讨论】:

  • 收到同样的警告。
猜你喜欢
  • 2018-12-02
  • 2021-12-15
  • 2013-08-30
  • 2011-04-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多