I have a form and a csv file. The inputs go into the csv quite well but for some odd reason, they display in one row... why is that? I want multiple rows per submission...
PHP:
<?php
$fn = $_POST['fn'];
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comments = $_POST['comments'];
//$emailMe = (isset($_POST['emailMe'])) ? $_POST['emailMe'] : 'No';
//validate
if(empty($fn) || empty($name) || empty($email) || empty($phone)){
$message = 'Fill in areas in red!';
$aClass = 'errorClass';}
$cvsData = $fn . "," . $name . "," . $email . "," . $phone . "," . $comments . "\n";
$fp = fopen("form_data.csv", "a" );
if($fp){
fwrite($fp, $cvsData);
fclose($fp);
}
?>