【问题标题】:How to solve headers already sent by error in sqladmin.php on line 636如何解决第 636 行的 sqladmin.php 中已由错误发送的标头
【发布时间】:2014-05-02 06:12:29
【问题描述】:

我需要一些帮助来解决我在提交数据后收到的这个错误。数据提交成功,但每次我提交数据“下方”时都会看到此错误

Array
(
    [0] => ../upload/tmp/eb56163c635cf89918baa7ed93b9adee_3.jpg
    [1] => ../upload/tmp/eb56163c635cf89918baa7ed93b9adee_3.jpg.jpg
    [2] => 91
    [3] => 76
    [4] => 92
    [5] => 140
    [6] => 91
    [7] => 76
)
Array
(
    [image] => Resource id #203
    [type] => 2
    [width] => 500
    [height] => 450
)

Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/admin/lib/debug.php:25) in /home/mysite/admin/lib/sqladmin.php on line 636

/home/mysite/admin/lib/debug.php 文件如下:

<?php


// dependencies


/**
* description
*
* @param
*
* @return
*
* @access
*/
function PrintR($array , $die = false) {
    echo "<table><tr><td><pre style=\"background-color:white\">";
    print_r($array);
    echo "</pre></td></tr></table>";

    if ($die)
        die();
}


/**
* description
*
* @param
*
* @return
*
* @access
*/
function Debug($array , $die = false) {
    if ($_SERVER["REMOTE_ADDR"] != "127.0.0.1") {
//      return "";
    }

    PrintR($array , $die);
}




?>

为了更容易:/home/mysite/admin/lib/sqladmin.php 在第 636 行

header("Location:" . $this->templates["generic_form"]->blocks["Temp"]->Replace(array_merge($_GET,$_POST)));
                            exit;

【问题讨论】:

    标签: php warnings


    【解决方案1】:

    标头函数在运行之前不希望输出任何内容。通过像您一样打印数组或从 debug.php 文件中回显错误(这似乎是这里的情况),这意味着正在写入输出,这将导致标题冲突。尝试删除它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-17
      • 1970-01-01
      • 2019-11-08
      • 2012-11-07
      • 2022-01-06
      相关资源
      最近更新 更多