Please see the code below first. Code: <?php $savedata = $_REQUEST['savefeedback']; if ($savefeedback == 1){ $data = $_POST['name']; $data .= $_POST['feedback']; $file = "feedback.txt"; $fp = fopen($file, "a") or die("Couldn't open $file for writing!"); fwrite($fp, $data) or die("Couldn't write values to file!"); fclose($fp); echo "Your Form has been Submitted!"; } ?> Output : NaimishYour Website is very nice. JohnI will visit your website now. Now What I want to do is, the output should be like this, Naimish Your Website is very nice. John I Will visit your website now. How can I apply code for a new line in below code ? Code: $data = $_POST['name']; $data .= $_POST['feedback'];
Code: <html dir="ltr"> <head> <title></title> <?php $name = $_POST['name']; $email .= $_POST['email']; $count = $email."/n".$name."/n"; $file = fopen("YOURDATAFILE.txt", "a"); fputs($file, "$name $email"); fclose($file); ?> </head> <body> </body> </html> Nothing working
Code: fputs($file, "$name $email"); What needs to put in between $name and $email to get $email printed on next line ?