this is my code:-
sample1.php
name
Address
Town
Phone
sample2.php
<?php $n=$_POST['name']; $a=$_POST['address']; $t=$_POST['town']; $p=$_POST['phone']; $e=$_POST['email']; $string = "$n,$a,$t,$p,$e"; $newline="\r\n"; $filename = "details.csv"; if (file_exists($filename)) { $file = fopen($filename, "a"); fwrite($file, $newline); fwrite($file, $string); } else { $file = fopen($filename, "a"); fwrite($file, '"Name","Address","Town","Phone","Email"'); fwrite($file, $newline); fwrite($file, $string); } fclose($file); ?>This code works fine if there is only one line in the text area. If we enter more than one line by pressing the enter key the code doesnot work.The data is inserted into the file,but not under corresponding column.
For everyone this may seem stupid question.But am a beginner in PHP.Please anyone help.