title: Write text file php
body: <p>Im using php. </p>
  
  <p>I want to write a php page to get parameters from another page and write to a file text. And: </p>
  
  <ul>
  <li><p>If already have file text, it write to a new line</p></li>
  <li><p>Each day create one file text</p></li>
  </ul>
  
  <p>Example:</p>
  
  <p>register.php</p>
  
  <pre><code>&lt;body&gt;
      &lt;form action='process.php' method='GET'&gt;
          Name: &lt;input type='text' name='name'/&gt;
          &lt;br/&gt;
          Age: &lt;input type='text' name='age'/&gt;
          &lt;br/&gt;
          &lt;input type='submit' value='SUBMIT'/&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>process.php</p>
  
  <pre><code>$name = $_GET['name'];
  $age = $_GET['age'];
  
  $file_handle = fopen("testFile.txt", "w");
  $file_contents = "name:" . $name . "age:" . $age;
  
  fwrite($file_handle, $file_contents);
  fclose($file_handle);
  print "file created and written to";
  </code></pre>
  
  <p>How can I do this?</p>