简体   繁体   中英

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:

<?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

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. Try removing it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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