Php 此修改标头出错

Php 此修改标头出错,php,html,Php,Html,只是给你一个简短的背景,我正在与一个推荐程序,它的主要特点是推荐某人 在我的网站上。我有注册页面,登录页面,成功注册页面,推荐页面和推荐列表 例如,如果您是用户,则必须通过注册页面进行注册。如果您在我的页面上成功注册,下一页将是成功注册页面。那里有一个按钮,可以转到转诊页面转诊某人 我遇到的问题是,我注册为新用户。所以肯定的是,我在注册页面上填写了所有必要的信息,在我成功注册之后,下一个页面将显示成功注册页面,在该页面上有一个按钮,一旦你点击它,它将进入推荐表单页面 例如,我现在将推荐某人,因此

只是给你一个简短的背景,我正在与一个推荐程序,它的主要特点是推荐某人

在我的网站上。我有注册页面,登录页面,成功注册页面,推荐页面和推荐列表

例如,如果您是用户,则必须通过注册页面进行注册。如果您在我的页面上成功注册,下一页将是成功注册页面。那里有一个按钮,可以转到转诊页面转诊某人

我遇到的问题是,我注册为新用户。所以肯定的是,我在注册页面上填写了所有必要的信息,在我成功注册之后,下一个页面将显示成功注册页面,在该页面上有一个按钮,一旦你点击它,它将进入推荐表单页面

例如,我现在将推荐某人,因此我填写了所有信息,因此当我尝试提交我的推荐时,有一个错误提示我的页面

谁能告诉我哪行代码触发了这个错误:

警告:无法修改标题信息-标题已由发送 (输出开始于 /home/thecommissioner/public_html/crm/include/Webservices/Utils.php:880) 在里面 /home/thecommissioner/public_html/crm/modules/Webforms/capture_old.php 在线97

但是我的推荐列表中添加了推荐,所以当我再次尝试推荐时,此错误将不再显示。。。即使我多次引用,这个错误也不再显示。它仅在新创建的帐户的第一次转介尝试时显示。我不知道是什么问题

这只是显示在我第一次尝试推荐某人时,但之后,当我尝试推荐更多人时,这将不再显示,我已经添加了我的推荐。有人能帮我弄清楚吗

我知道这里有几个教训,我已经在stackoverflow上读过关于这方面的不同帖子,对此我仍然含糊不清。你介意告诉我我可以用什么新代码来代替我现在的代码吗?因此,我无法测试我的页面是否正常工作

这是我的密码:

<!DOCTYPE html>
<?php
include('../include/dbconnection.php');
include('../include/functions.php');

if(!isset($_SESSION))
{
session_start();
}
$empid = $_SESSION['SESS_EMP_ID'];
$conid = $_SESSION['SESS_CONID'];
$fName = $_SESSION['SESS_FIRSTNAME'];
$lName = $_SESSION['SESS_LASTNAME'];
$contactNo = $_SESSION['SESS_CONTACT_NO'];
$mobile = $_SESSION['SESS_MOBILE'];
$email = $_SESSION['SESS_EMAIL'];
$bday = $_SESSION['SESS_BDAY'];

if($conid == '')
{
echo ("<SCRIPT LANGUAGE='JavaScript'>
    window.location.href='index.php';
    </SCRIPT>");
}

else
{
//Nothing
}
?>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/skeleton.css">
<link rel="stylesheet" href="../css/successReg_style.css">
<link rel="icon" type="image/png" href="../images/cvglogo.png">
<link rel="short icon" href="../images/favicon.ico">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript"></script>
<link rel="stylesheet" href="../css/animate.css">
</head>

<body>

 <!--Here the Header goes-->
 <?php include('include/logoheader.php'); ?>


    <!-- Overall Contect for Responsive Purposes-->
    <div class="allcontent">
        <div class="row">
                <div class="twelve columns" style="margin-top:0%;">

                    <!-- Here the Main Content goes-->
                    <div="maincontent">
                        <center>
                            <h3>Congratulations and Welcome to the Circle!</h3>
                            <br>

                            <div class=" animated zoomIn socialmedia">
                                <ul>
                                    <li>
                                    <img class="logos" src="../images/tick.png">
                                    </li>  
                                </ul>
                            </div>

                            <!-- This is the welcome Introduction -->
                            <div class="welcome">
                                <p>Now that you’re part of the most awesome group on the planet, why not share the glory with your friends. There’s no happier  
                                team 
                                player than a team player with his friends.</p>
                                <span class="hit">Don’t be shy. Hit the button. Refer your friend!</span><br>


                <!-- This is Just a GIF arrow down -->
                            <div class="demo-wrapper">
                                <div class="html5-dialog">
                                        <div class="gif">
                                            <img src="../images/scroll-down.gif">
                                        </div>
                                        <?php include('GlobalConstant.php'); ?>
                                        <!-- But here goes the button for "I have someone in mind" -->
                                        <a href="<?php echo employee_refer; ?>"><button class="navbutton">I have someone in mind</button>   
                                        </a>
                                </div>
                         </div>
                </div>
        </div>
 </div>

             <!-- Here the footer goes-->
         <center><?php include("include/footer.php"); ?></center>

 </body>
 </html>

祝贺你,欢迎来到这个圈子!

既然你是这个星球上最棒的团队的一员,为什么不和你的朋友们一起分享这份荣耀呢。没有比这更快乐的了 团队 和他的朋友们在一起,他比一个团队成员更重要

别害羞。按一下按钮。推荐你的朋友
错误:

警告:无法修改标题信息-标题已由发送 (输出开始于 /home/thecommissioner/public_html/crm/include/Webservices/Utils.php:880) 在里面 /home/thecommissioner/public_html/crm/modules/Webforms/capture_old.php 在线97

仅在我第一次尝试引用时显示,之后,当我引用更多时,上述警告/错误不再显示


如果这些警告只是在我第一次尝试引用时显示,为什么下次我再次引用时它不会显示?它只是在我第一次尝试时显示出来的

在发送任何输出之前,您需要发送标题。这意味着在HTML之前,在页面顶部


或者,正如RamRider所建议的,使用输出缓冲

在页面顶部和

ob_end_clean() 

在最底层

您需要在发送任何输出之前发送标题。这意味着在HTML之前,在页面顶部


或者,正如RamRider所建议的,使用输出缓冲

在页面顶部和

ob_end_clean() 

在最底层

您需要将session_start()函数放在代码顶部。否则,php有时会抛出已经发送的异常头

    <?php
    session_start();

    include('../include/dbconnection.php');
    include('../include/functions.php');


    $empid = $_SESSION['SESS_EMP_ID'];
    $conid = $_SESSION['SESS_CONID'];
    $fName = $_SESSION['SESS_FIRSTNAME'];
    $lName = $_SESSION['SESS_LASTNAME'];
    $contactNo = $_SESSION['SESS_CONTACT_NO'];
    $mobile = $_SESSION['SESS_MOBILE'];
    $email = $_SESSION['SESS_EMAIL'];
    $bday = $_SESSION['SESS_BDAY'];

    if($conid == '')
    {
    echo ("<SCRIPT LANGUAGE='JavaScript'>
        window.location.href='index.php';
        </SCRIPT>");
    }

    else
    {
    //Nothing
    }
    ?>
   <!DOCTYPE html>
    <html lang="en">

    <head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="../css/normalize.css">
    <link rel="stylesheet" href="../css/skeleton.css">
    <link rel="stylesheet" href="../css/successReg_style.css">
    <link rel="icon" type="image/png" href="../images/cvglogo.png">
    <link rel="short icon" href="../images/favicon.ico">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script type="text/javascript"></script>
    <link rel="stylesheet" href="../css/animate.css">
    </head>

    <body>

     <!--Here the Header goes-->
     <?php include('include/logoheader.php'); ?>


        <!-- Overall Contect for Responsive Purposes-->
        <div class="allcontent">
            <div class="row">
                    <div class="twelve columns" style="margin-top:0%;">

                        <!-- Here the Main Content goes-->
                        <div="maincontent">
                            <center>
                                <h3>Congratulations and Welcome to the Circle!</h3>
                                <br>

                                <div class=" animated zoomIn socialmedia">
                                    <ul>
                                        <li>
                                        <img class="logos" src="../images/tick.png">
                                        </li>  
                                    </ul>
                                </div>

                                <!-- This is the welcome Introduction -->
                                <div class="welcome">
                                    <p>Now that you’re part of the most awesome group on the planet, why not share the glory with your friends. There’s no happier  
                                    team 
                                    player than a team player with his friends.</p>
                                    <span class="hit">Don’t be shy. Hit the button. Refer your friend!</span><br>


                    <!-- This is Just a GIF arrow down -->
                                <div class="demo-wrapper">
                                    <div class="html5-dialog">
                                            <div class="gif">
                                                <img src="../images/scroll-down.gif">
                                            </div>
                                            <?php include('GlobalConstant.php'); ?>
                                            <!-- But here goes the button for "I have someone in mind" -->
                                            <a href="<?php echo employee_refer; ?>"><button class="navbutton">I have someone in mind</button>   
                                            </a>
                                    </div>
                             </div>
                    </div>
            </div>
     </div>

                 <!-- Here the footer goes-->
             <center><?php include("include/footer.php"); ?></center>

     </body>
     </html>

祝贺你,欢迎来到这个圈子!

既然你是这个星球上最棒的团队的一员,为什么不和你的朋友们一起分享这份荣耀呢。没有比这更快乐的了 团队 和他的朋友们在一起,他比一个团队成员更重要

别害羞。按一下按钮。推荐你的朋友