title: How to load text from a file to text area using javascript using input type file?
body: <pre><code>&lt;script type="text/javascript"&gt;
  function CopyMe(oFileInput) {
  var filePath = oFileInput.value;
      fh = fopen(filePath, 0);
      if (fh!=-1) {
          length = flength(fh);
          str = fread(fh, length);
          fclose(fh);
      }
  document.getElementByID('myText').innerHTML = filePath;
  }
  &lt;/script&gt;
  &lt;input type="file" onchange="CopyMe(this);"/&gt;
  &lt;textarea id="myText"&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p>I do get any output/change in the text area!
  What should I do ?
  Please help!</p>
  
  <p>I used the following php codo for that, I dont know whether it is correct</p>
  
  <pre><code>&lt;?php
  function Read($file){
  echo file_get_contents($file);
  };
  ?&gt;
  </code></pre>
  
  <p>Following was the javascript:</p>
  
  <pre><code>    function CopyMe(oFileInput) {
      var filePath = oFileInput.value;
      document.getElementByID('text-area3').innerHTML = "&lt;?php Read(filePath);?&gt;";
      }
  </code></pre>
  
  <p>Any suggestions ... ???</p>