• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[PHP] New line

Status
Not open for further replies.

Jesper_Kladden

Donator
Joined
May 16, 2008
Messages
458
Reaction score
1
Location
Sweden
Hello y'all.

This time I need help with creating a new line in my msg.txt file.

I've tried about everything. Please do not tell me to google, I've tried.

Could someone help me?

PHP:
<?
$IP = $_SERVER['REMOTE_ADDR']; 
$REPORTMSG = $_POST['message'];
$string = "IP:$ip, REPORT: $REPORTMSG |... ";
$a = fopen("msg.txt", "a"); 
fputs($a, $string); 
fclose($a);
?>

The code is working perfectly. It gets the information from the Textbox(@HTML it's called TextArea), it gets the information into msg.txt.

The problem is that I want to create a new line, because when it enters the report it goes like this:

IP:$ip, REPORT: $REPORTMSG |...IP:$ip, REPORT: $REPORTMSG |...

But I want it to be like this:

IP:$ip, REPORT: $REPORTMSG |...
IP:$ip, REPORT: $REPORTMSG |...
IP:$ip, REPORT: $REPORTMSG |...
IP:$ip, REPORT: $REPORTMSG |...


Then it's easier to read. I hope you all understood my need, and please help me ! (Rep will be done.)
 
Where should the \n be ? I didn't really understand.

PHP:
$string = "IP:$ip, REPORT: $REPORTMSG |... "."\n";

I've tried this, didn't work.
 
Yes yes, exactly that, it work ;)

PS. Remember to not use Windows notepad! :) Use Notepad++ or something which will read new lines property.
 
Status
Not open for further replies.

Similar threads

Back
Top