warning: header information
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8028957/headers-already-sent-by-php">Headers already sent by PHP</a>  </p>
</blockquote>



<p>I am a begginner  in php and I want to create an download button but I received an error that i don't understand.
This is my error:</p>

<blockquote>
  <p>"Warning: Cannot modify header information - headers already sent by (output started at D:\Program Files\xampp\htdocs\FormsGenerator\index.php:125) in D:\Program Files\xampp\htdocs\FormsGenerator\download.php on line 11"</p>
</blockquote>

<p>On 125 row I had open the tag for php to call the functions created.
This is my cod for button functionality:</p>

<pre><code>&lt;?php
class fileDownload{
  function fileDownload(){
      $core_path = dirname(__FILE__);
      $file_path = "{$core_path}/file/form.html";
      $file_info = array(
            'name' =&gt; basename($file_path),
            'size' =&gt; filesize($file_path)
        );

      header('Content-Type: application/html');
      header('Content-Description: File Transfer');
      header('Content-Disposition: attachment; filename="'.$file_info['name'].'"');
      header('Content-Lenght: '.$file_info['size']);
      $file = fopen($file_path, 'rb');

      while(!feof($file)){
        echo fread($file, 256);
      }

      fclose($file);
      return;
  }
}
?&gt;
</code></pre>

<p>And here is the created object that calls the class:</p>

<pre><code>if(isset($_GET['download'])){
       include 'download.php';
        $download = new fileDownload();
}
</code></pre>

<p>Can someone help me?</p>
