Jump to content

Help with a line break


idutchie

Recommended Posts

Hello, I have made a page that allows a user to enter their name and a message into a form. After they click submit, the information is appended to a text file. I am having a problem though getting a line break after each field sent. Here is my code so far:

<?php
$myFile = "myfile.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = $_POST['name'];
fwrite($fh, $stringData);
$stringData = $_POST['message'];
fwrite($fh, $stringData);
fclose($fh);

?>

How can I make it so that there is a line break added to the text file after the 'name' variable and 'message' variable?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/199547-help-with-a-line-break/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.