标题位置不工作在线godaddy托管,但在本地主机上工作

时间:2016-07-13 06:42:42

标签: php mysqli localhost hosting

标题位置在本地主机上工作完美但在godaddy托管在线无法工作如何解决此问题这是我的登录代码

    ob_start();
include("includes/connect.php");
 if(isset($_SESSION['username'])){ 
 $username=$_SESSION['username'];echo $_SESSION["username"];
 $query=mysqli_query($conn,"select* from tbl_user where db_username='$username'")or die(mysqli_error($conn));
 $res=mysqli_fetch_array($query);
 $fname=$res['db_fname'];
 $lname=$res['db_lname'];
 }else{
 if(!isset($_SESSION['username']) || $_SESSION['username']==""  ){
 header("location:index.php");}} 
     ob_end_flush();

主页代码

     ob_start();
    session_start();

    if(empty($_SESSION['username'])) {
        echo'
        <nav class="navbar navbar-default" role = "navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="main.php"><img src="img/t-square-logo-Final.png" alt="the professionals" width="200px" style="float:left;margin-top:41px;" /></a>
    </div>
    <div class = "collapse navbar-collapse" id = "example-navbar-collapse">
         </div>
  </div></div>
</nav>
   </div>';
    }
    else{
        if($_SESSION['level']==0){
        echo'
        <nav class="navbar navbar-default" role = "navigation">
  <div class="container-fluid">
    <div class="navbar-header">
    <button type = "button" class = "navbar-toggle" 
         data-toggle = "collapse" data-target = "#example-navbar-collapse">
         <span class = "sr-only">Toggle navigation</span>
         <span class = "icon-bar"></span>
         <span class = "icon-bar"></span>
         <span class = "icon-bar"></span>
      </button>
      <a class="navbar-brand" href="main.php"><img src="img/t-square-logo-Final.png" alt="the professionals" width="200px" style="float:left;margin-top:41px;" /></a>
    </div>
    <div class = "collapse navbar-collapse" id = "example-navbar-collapse">
    <ul class="nav navbar-nav">
      <li ';?><?php if ($page_name=="search.php") 
echo"class=\"active\""; ?><?php echo'><a href="search.php">Order</a></li>
<li><a href="task/task.php?action=">Task</a></li>
      <li><a href="logout.php">Logout</a></li> 
    </ul>
  </div>
  </div></div>
</nav>
   </div>';}ob_end_flush();

我的标题中有一些PHP代码

error_reporting(E_ALL);

我用它来打印错误

{{1}}

这是我的错误,但我不知道如何解决它 警告:无法修改标题信息 - 第39行/home/mhmd2991/public_html/index.php中已经发送的标题(/home/mhmd2991/public_html/index.php:2中的输出开始)

0 个答案:

没有答案