title: Text entered in TextArea of html page not saving in text file.
body: <p>I am trying to save the data entered in HTML form in a text file. I am using a php script to do this. 
  When I click on submit button, it does not save the data in text file. 
  Can someone tell me what is going wrong here. </p>
  
  <p>Below is the code snippet - </p>
  
  <p><strong>HTML Form -</strong> </p>
  
  <pre><code>&lt;form id="post" name="post" method="post" action="input.php"&gt;
      Name: &lt;input type="text" name="name"&gt;&lt;br&gt;
      Text: &lt;textarea rows="50" cols="85" name="blogentry"&gt;&lt;/textarea&gt;
      &lt;input class="button" type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP -</strong> (input.php)</p>
  
  <pre><code>&lt;html&gt;
     &lt;head&gt;&lt;/head&gt;
     &lt;body&gt;
     &lt;?php 
  
     // variables from the form
     $name = $_POST['name'];
     $blogentry = $_POST['blogentry'];
  
      // creating or opening the file in append mode
      $dataFile = "data.txt";
      $fh = fopen($dataFile, 'a');
  
      // writing to the file
      fwrite($fh, "Name - " . " " . $name . " " . "\n");
      fwrite($fh, "Blog - " . " " . $blogentry . " " . "\n\n");
  
      fclose($fh);
      ?&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>