简体   繁体   English

由于已在行发送的标头导致标头重定向错误

[英]header redirection error due to headers already sent at line

I am using header redirection but it not seems to be working for me it was before it suddenly stopped.我正在使用标头重定向,但在它突然停止之前似乎对我不起作用。 I googled it and found out that headers already sent is a possible reason for those.我用谷歌搜索,发现已经发送的标头是这些的可能原因。 I have tried a number of solutions but none of them worked for me.我尝试了许多解决方案,但没有一个对我有用。 Here's the initial code (it's not the full code because my errors are up until the end of this code, not afterwards)这是初始代码(它不是完整代码,因为我的错误一直到这段代码结束,而不是之后)

<?php ini_set('display_errors',1);error_reporting(E_ALL);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script>
     var price="";
    var check=new Array();
    </script>
    <style>

    <!--code for removing spinner-->
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    input[type=number] {
        -moz-appearance:textfield;
    }
    <!--code for removing spinner-->

    </style>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Cart</title>
    <link rel="stylesheet" type="text/css" href="engine1/style.css" />
    <link rel="stylesheet" href="css/bootstrap.css" />
    <link rel="stylesheet" href="css/mystyle.css"  />
    <link rel="stylesheet" href="css/responsive.css"  />
    <script type="text/javascript" src="engine1/jquery.js"></script>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
</head>

<body class="loading">
    <div class="wrapper">   
         <?php $pagename="cart";
             include("inc/header.php"); ?>
            <div class="faq-bg cartbg">
                <h1>Your cart</h1>
            </div>
        <?php   
/////////////////////////db is initialized in this class manually
//session_start();
    unset($_SESSION['address1-session']);
    unset($_SESSION['address1-2-session']);
    unset($_SESSION['city1-session']);
    unset($_SESSION['state1-session']);
    unset($_SESSION['postalcode1-session']);
    unset($_SESSION['address2-session']);
    unset($_SESSION['address2-2-session']);
    unset($_SESSION['city2-session']);
    unset($_SESSION['state2-session']);
    unset($_SESSION['postalcode2-session']);
    unset($_SESSION['puppy_name-session']);
    unset($_SESSION['puppydate-session']);
    unset($_SESSION['error']);
    unset($_SESSION['flag']);
    unset($_SESSION['unique_id']);
    unset($_SESSION['flagshipping']);
    //unset($_SESSION['sess_user']);
    unset($_SESSION['quantity']);
    unset($_SESSION['bundleplan']);
    unset($_SESSION['dogsize']);
    unset($_SESSION['extrapuppy']);
    unset($_SESSION['toycount']);

Here's the url of the project I am working on so you can see the error.这是我正在处理的项目的url ,因此您可以看到错误。

This normally can be resolved by a quick custom .user.ini alteration:这通常可以通过快速自定义 .user.ini 更改来解决:

1) Create a custom .user.ini file (if there isn't one already) 1)创建一个自定义的 .user.ini 文件(如果还没有的话)

2) Locate the line that looks like: 2) 找到如下所示的行:

output_buffering = Off输出缓冲 = 关

3) Change the output_buffering line to: 3) 将 output_buffering 行更改为:

output_buffering = On输出缓冲 = 开

This should be all that is needed to bring the site back online.这应该是使站点重新上线所需的全部内容。

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

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