Can someone advise what i’m doing wrong? or if i’m going the wrong way about it?
I want to concatenate 2 strings from 2 textareas and insert them into a column in my table.
this bit of code is from the send message page,
$msgfull is the message that the user wishes to send,
$msqquote is the message the user is replying to (displayed in a read only textarea)
$recipient= $_POST['sendto'];
$subjectmsg= $_POST['subject'];
$msgfull= $_POST['messagetext'];
$msgquote= $_POST['replyquote'];
$date = date('Y-m-d H:i:s');
$replyupdate = $msgfull."\n".$msgquote;
I want to insert $replyupdate into the table.
It works how it is, BUT, it doesn’t give me the line break, it just puts it all into one line.
on the View Message page, I want $msgfull to show first, then a line break (or 2) then the $msgquote (original message) to be displayed.
Can anyone advise please?
Note: I am aware of the security issues on my POST data, They are old scripts I am amending and slowly removing all the mysql commands.
while displaying the string, use
nl2brfunction which converts all\nchars to<br />ref: http://php.net/manual/en/function.nl2br.php