title: Print php data in new tab
body: <p>I have a simple php code like this:</p>
  
  <pre><code>    //index.php
      $file  = fil1.txt;
      //open file using fopen...
      echo $file;
  </code></pre>
  
  <p>What should I do if I need to print my file data in new tab in another php file(e.x. result.php) ?</p>
  
  <p>This is real my example of code:</p>
  
  <pre><code>function elementStart($parser, $name, $attrs) {
  global $depth;
  
  echo str_repeat("&amp;nbsp;", $depth * 0); 
  //echo "&lt;b&gt;$name&lt;/b&gt;&lt;br&gt;";     
  
  $depth++; 
  
      foreach ($attrs as $attr =&gt; $value) {
          echo str_repeat("&amp;nbsp;", $depth * 0); 
  
          echo $value.'&lt;br&gt;';
      }
  }
  
  function elementStr($parser, $str) {
      if (strlen(trim($str)) &gt; 0) {
          global $depth;
  
          echo str_repeat("&amp;nbsp;", $depth * 0); 
          echo $str.'&lt;br&gt;'; 
      }
  }
  
  function elementEnd($parser, $name) {
      global $depth;
  
      $depth--;
  }
  
  require_once 'connect.php';
  
  if(isset($_POST['submit1']))
  {
  
  $db = new database('localhost', 'root', '', 'database1');
  $val = mysql_escape_string($_POST['xml1']); 
  $db-&gt;query("SELECT * FROM xmltable1 WHERE xmlvalue LIKE '%$val%' LIMIT 1");
  if($_POST['submit1'])
  {
  
  
  
      if($dbase-&gt;numRows() == 0){
          echo 'No rows';
      }
      else{
          foreach($db-&gt;rows() as $name){
              //echo $name['xmlvalue'];
  
              define('FOLDER_PATH', 'C:user/folder1/xmld/');
              $full_path = FOLDER_PATH.$name['xmldata'];
              //echo $full_path;
                      $depth = 0;
                      $file  = $full_path;
  
                      $xml_parser = xml_parser_create();
  
                      xml_set_element_handler($xml_parser, "elementStart", "elementEnd");
                      xml_set_character_data_handler($xml_parser, "elementStr");
  
  
                      while ($data = fgets($fp)) {
  
                      thexml_parser_free($thexml_parser);
  
              }
  
          }
      }
  
  $dbase-&gt;disconnect();
  }
  </code></pre>
  
  <p>In my functions there are echo. And of course I get echo in current page, but I need echo in new tab.</p>