2015-04-04 66 views
0

在configuration.php第6行顯示錯誤。警告:無法修改標題信息 - 已經發送的標題(在/ home/midhu/public_html/feedback開始輸出/config/configuration.php:6)在上線/home/midhu/public_html/feedback/submit.php 29警告:無法修改標題信息 - 已由第29行中的錯誤發送標題

1. opendb.php 
<?php 
$con = mysql_connect('localhost','midhu_feedback','[email protected]') or die('Error connecting to mysql'); 
    mysql_select_db(midhu_feedback); 
    ?> 

2.configuration.php 

    <?php 
       $host='localhost'; 
       $dbname='midhu_feedback'; 
       $username='feedback'; 
       $password='[email protected]'; 
      ?> 

3. submit.php 


    <?php 
       session_start(); 
       include("../feedback/config/configuration.php"); 
       include("../feedback/config/opendb.php"); 
       $sql="insert into feedback(name,mobile,place,class,email,college,technologies_interested_in,mobile_apps_development,feedback,interested_to_study_latest_technologies)values('".$_SESSION["name"]."','".$_SESSION["phone"]."','".$_SESSION["place"]."','".$_SESSION["class"]."','".$_SESSION["email"]."','".$_SESSION["college"]."','".$_SESSION["technology"]."','".$_SESSION["mobile"]."','".$_SESSION["feedback"]."','".$_SESSION["interested"]."')"; 

       mysql_query($sql); 

       $sql="select * from feedback where mobile='".$_SESSION["phone"]."'"; 
       $result=mysql_query($sql); 


       while($row=mysql_fetch_array($result)) 
       { 
        $id=$row['id']; 
        $name=$row['name']; 
        $phone=$row['mobile']; 
        $place=$row['place']; 
        $class=$row['class']; 
        $email=$row['email']; 
        $college=$row['college']; 
        $technology=$row['technologies_interested_in']; 
        $mobile=$row['mobile_apps_development']; 
        $feedback=$row['feedback']; 
        $interested=$row['interested_to_study_latest_technologies']; 


       } 
       header('location:display.php?id='.$id.'&name='.$name.'&phone='.$phone.'&place='.$place.'&class='.$class.'&email='.$email.'&college='.$college.'&technology='.$technology.'&mobile='.$mobile.'&feedback='.$feedback.'&interested='.$interested); 

      $_SESSION['name']; 
      $_SESSION["phone"]; 
      $_SESSION["place"]; 
      $_SESSION["class"]; 
      $_SESSION["email"]; 
      $_SESSION["college"]; 
      $_SESSION['technology']; 
      $_SESSION['mobile'];   
      $_SESSION['feedback']; 
      $_SESSION['interested']; 

      $_SESSION["phone"]=$phone; 
     ?> 

頁 Display.php的

 <style> 
      a{ 
       margin-left: 20px; 
       padding-left: 20px; 
       } 
      #table{ 
        padding-left:20px; 

       } 
      #border{ 
        border: 2px solid rgb(92, 184, 92) !important; 
        height: 179px; 
        width: 235px; 
       } 
      h5{ 
       padding-left:20px; 
       } 
      #table{ 
       padding-left:20px; 
        margin-left: 20px; 
       } 

     </style> 

    </head> 

<body><br><br> 
<div class="container"><br> 

      <br><a href="export.php" class="btn btn-success" >EXPORT TO PDF</a><br><br> 
      <h5><i> Submitted data successfully... </i></h5><br> 
       <div id="table"> 
        <table border="1" > 



         <tr> 
           <th>Sl.No</th> 
           <th>Name</th> 
           <th>Mobile</th> 
           <th>Place</th> 
           <th>Class</th> 
           <th>Email</th> 
           <th>College</th> 
           <th>Technologies Interested In</th> 
           <th>Mobile Apps development</th> 
           <th>Feedback</th> 
           <th>Interested To Study Latest Technologies</th> 
         </tr> 

         <tr> 
           <td><?php echo $_GET['id']; ?></td> 
           <td><?php echo $_GET['name']; ?></td> 
           <td><?php echo $_GET['phone']; ?></td> 
           <td><?php echo $_GET['place']; ?></td> 
           <td><?php echo $_GET['class']; ?></td> 
           <td><?php echo $_GET['email']; ?></td> 
           <td><?php echo $_GET['college']; ?></td> 
           <td><?php echo $_GET['technology']; ?></td> 
           <td><?php echo $_GET['mobile']; ?></td> 
           <td><?php echo $_GET['feedback']; ?></td> 
           <td><?php echo $_GET['interested']; ?></td> 
         </tr> 

        </table> 
       </div> 

</div> 

</body> 

+1

請不要使用'mysql_ *'充當他們被取消,並將不再在使用更高版本的PHP – Ikari 2015-04-04 07:53:56

+0

那麼我如何檢索$ sql =「select * from feedback where mobile ='」。$ _ SESSION [「phone」]。「'」;結果 – 2015-04-04 07:56:34

+0

使用可以使用'PDO'或'mysqli_ *'功能。我個人比較喜歡'PDO',但是你可以使用類似'mysql_ *'函數的'mysqli_ *'函數。 – Ikari 2015-04-04 07:58:56

回答

0

ob_start();submit.php頁面的頂部。您有一個輸出調用header();

閱讀以前更在:

http://php.net/manual/en/function.ob-start.php

+0

itz已經在頁面頂部 – 2015-04-04 07:22:34

+0

@MidhuT你可以正確地格式化你的問題,因爲它看起來像一個單一的文件 – 2015-04-04 07:24:56

+0

什麼是你的代碼中的configuration.php和submit.php – Saty 2015-04-04 07:27:15

相關問題