Home>

I get an error in the production environment of php7.
It is an inquiry function in zeromail.php.

Since I don't touch php in the source of the person who made it before (* wordpress, scss, css, html are fine), I have no idea how to solve the error.

The browser says that there is an error in header ('Location:'. SUCCESSPAGE) ;, but I don't know how to fix it.

Please kindly advise.

Warning: Cannot modify header information --headers already sent by (output started at directory zeromail.php: 676) in directory
// Automatic reply body shaping
    if (strpos (PHPVER, '5') === false) {
        $replymessage = unhtmlentities ($replymessage);
    } else {
        $replymessage = html_entity_decode ($replymessage, ENT_QUOTES,'UTF-8');
    }
        $replymessage = str_replace ("\ r", "", str_replace ("<br />", "", $replymessage));
        @mb_send_mail ($formitem ['email'], REPSUBJECT, $replymessage, $replyheader);
    }
    if (is_admin ()) zeromail_data_put_csv ($csv);// Save CSV
    session_destroy ();
    if (NOSCRIPT === false) {
        print $endMassage;
    } else {
        header ('Location:'. SUCCESSPAGE);
    }
  • Answer # 1

    header ()This is because I have output something to RESPONSE BODY before.
    header ()Do not output any single character to RESPONSE BODY before the call.

    (www.php.net) header

    Keep in mind that the header () function must be called before any actual output, regardless of normal HTML tags or output from PHP.

Related articles