title: PHP script to output an HTML form to txt file?
body: <p>I'm trying to create a PHP file that will write the text from an HTML form to a txt file, and then redirect the user to a page that tells them they're finished.</p>
  
  <p><strong>Here is my HTMl form:</strong></p>
  
  <pre><code>&lt;form action="feedbackScript.php"&gt;
   &lt;p&gt;
     Email(for response, optional) 
      &lt;input type="email" name="email" /&gt; &lt;br&gt;
     General feedback and comments
      &lt;textarea name="feedback" cols="100" rows="5"&gt;&lt;/textarea&gt; &lt;br&gt;
     Rating &lt;br&gt;
      &lt;select name="rating"&gt;
       &lt;option value="1"&gt;1&lt;/option&gt;
       &lt;option value="2"&gt;2&lt;/option&gt;
       &lt;option value="3"&gt;3&lt;/option&gt;
       &lt;option value="4"&gt;4&lt;/option&gt;
       &lt;option value="5"&gt;5&lt;/option&gt;
      &lt;/select&gt;
     Suggestions
      &lt;textarea name="suggestions" cols="100" rows="5"&gt;&lt;/textarea&gt; &lt;br&gt;
     Bug Report
      &lt;textarea name="bugReport" cols="100" rows="5"&gt;(Fill out this form)
       What happened: 
       What you expected to happen: 
       Anything extra: &lt;/textarea&gt; &lt;br&gt; &lt;br&gt;
       &lt;input type="submit" value="Submit" name="submit"/&gt;
   &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How can this be done?</p>
  
  <p>EDIT: Was originally going to use this:</p>
  
  <pre><code>&lt;?php
  
  // Open the text file
  $f = fopen("feedbacks.txt", "w");
  
  // Write text
  fwrite($f, $_POST['email'] &amp;&amp; $_POST['feedback'] &amp;&amp; $_POST['suggestions'] &amp;&amp; $_POST['bugReport']); 
  
  // Close the text file
  fclose($f);
  
  header('Location: suggestFinished.html'.$newURL);
  
  ?&gt;
  </code></pre>
  
  <p>Sorry for misleading title, another question I was going to post was still here and I forgot to edit the title</p>