2015-04-04 67 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

相关问题