无法修改标头信息-标头已由发送(输出在C:example


Cannot modify header information - headers already sent by (output started at C:xamp

我严重面临的问题是:无法修改已由out启动的头信息头放在。。。

<?php 
if ($_POST)
{
$counter = 0;
$Role = $_POST['urole'];
$Username = $_POST['uname'];
$Userid = $_POST['password'];
// validating field values
if($Role == "Select Role" || strlen($Username)<=0 || strlen($Userid)<=0)
{
$counter = 1;
echo "<center><font color=red><h3>"."Please, Provide values for all the fields"."</h3></font></center>";
exit;
}
$dbconnect = mysql_connect('localhost','root','');
if (!$dbconnect)
    {
    die ('could not connect:'.mysql_error());
    }
 $selectdb = mysql_select_db('UGI', $dbconnect);
 $query = "select EmployeeLoginType, EmployeeUserName, EmployeePassword from EmployeeCredentials where EmployeeLoginType='".$_POST['urole']."' and EmployeeUserName='".$_POST['uname']."' and EmployeePassword='".$_POST['password']."'";
 $dbquary = mysql_query($query, $dbconnect);
if (!$dbquary)
    {
    echo "No Record Found:".  mysql_error();
    }  
    else 
        {
        $rowfetch = mysql_fetch_array($dbquary);
        }
if (!$rowfetch)
    {
    echo ("<font color='red' size='+2'>Invalid Login Credentials</font>");
    }
    else {
              //      $username = $_POST['uname'];
                    $_SESSION['uname'] = $Username;
                    $role = $rowfetch[0];
                    $name = $rowfetch[1];
                    $password = $rowfetch[2];
         }
         if (strcasecmp($role, "Manager") === 0 && $name === "Bello" && $Userid === "smile2me")
         {
                        header('Location:PeopleManagement.php');
                      exit();    
         }

        /* else if 
                        (strcasecmp ($role, 'Assistant Manager') == 0 && $name == 'Ismail' && $Userid == $password)
                       header("Location:EditEmployeeDetails.php");
                    else if
                        (strcasecmp($role, 'Employee') == 0 && $Username ==$name  && $Userid == $password)
                        header("Location:Admin.php");

                    */
}enter code here
 // echo "<font color='red'><h3><em>Invalid Login credentials: Try again</em></h3></font>";

header()必须在任何echo之前调用。