title: How do I fix Warning: Cannot modify header information
body: <p>i have this code to export from mysql to excell in wordpress i am calling this file with link</p>
  
  <pre><code>    &lt;?php include("header.php"); 
  
      $table = 'driver_detail';
      $file = 'export';
  
      $result = mysql_query("SHOW COLUMNS FROM ".$table."");
      $i = 0;
      if (mysql_num_rows($result) &gt; 0) {
      while ($row = mysql_fetch_assoc($result)) {
      $csv_output .= $row['Field']."; ";
      $i++;
      }
      }
      $csv_output .= "\n";
      $values = mysql_query("SELECT * FROM ".$table."");
      while ($rowr = mysql_fetch_row($values)) {
      for ($j=0;$j&lt;$i;$j++) {
      $csv_output .= $rowr[$j]."; ";
      }
      $csv_output .= "\n";
      }
  
      $filename = $file."_".date("Y-m-d_H-i",time());
      header("Content-type: application/vnd.ms-excel");
      header("Content-disposition: csv" . date("Y-m-d") . ".csv");
      header( "Content-disposition: filename=".$filename.".csv");
      print $csv_output;
      exit;
      ?&gt;
  </code></pre>
  
  <p>but i am having this error .. how to fix this</p>
  
  <pre><code> Warning: Cannot modify header information - headers already sent by (output started at /home5/revoluv0/public_html/proj/autobodyparts/get-details/header.php:3) in /home5/revoluv0/public_html/proj/autobodyparts/get-details/export-driver.php on line 24
  </code></pre>