简体   繁体   English

如何解决第636行的sqladmin.php中已因错误发送的标头

[英]How to solve headers already sent by error in sqladmin.php on line 636

I need small help on how to solve this error that I receive after I submit data. 我需要一些小小的帮助,以解决提交数据后收到的此错误。 data submit successfully but I see this error every time i do submit data "Below" 数据提交成功,但是每次我提交数据“以下”时,我都会看到此错误

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 file below: /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);
}




?>

To make it easier: /home/mysite/admin/lib/sqladmin.php on line 636 为了简化操作:第636行的/home/mysite/admin/lib/sqladmin.php

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

The header function expects nothing to be outputted before it is ran. 标头函数期望在运行之前不输出任何内容。 By printing the arrays like you did or echoing an error from the debug.php file (which seems to be the case here), that means the output is being written, and this will create a conflict for the header. 通过像您一样打印数组或在debug.php文件中回显错误(在这里似乎是这种情况),这意味着正在写入输出,这将对标头产生冲突。 Try removing it. 尝试将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM