title: php save to csv file
body: <p>I'm wanting to store basic data from a single form box and I've created this php code base, but it doesn't seem to be working.  Can someone take a glance and see if anything stands out to why this wouldn't work.
  <strong>Edit: the csv file never updates with new data</strong></p>
  
  <pre><code>if (isset($_POST["submit"])) 
  { 
      $name = $_POST["name"]; 
      date_default_timezone_set('America/New_York');
      $date = date('Y-m-d H:i:s');
  
      if (empty($name)) 
      { 
          echo "ERROR MESSAGE"; 
          die; 
      } 
      $cvsData ='"$name","$date"'.PHP_EOL; 
      $cvsData .= "\"$name\",\"$date\"".PHP_EOL; 
      $fp = fopen("emailAddressses.csv", "a");
  
      if ($fp) 
      { 
          fwrite($fp,$cvsData); // Write information to the file 
          fclose($fp); // Close the file 
      }
  }
  </code></pre>