Page 1 of 1

Simple message interface

Posted: Thu Nov 10, 2005 6:13 am
by mhouldridge
Hi,

I have added a simple message facility to our Intranet however the content of each message does not include the paragraphs entered by the sender like the below.

I would like the message to display as follows;


Hi,

This is my email to you.

Me


However the message appears as follows from my echo output;

Hi, This is my email to you. Me.

Any ideas?

Posted: Thu Nov 10, 2005 6:14 am
by Charles256
lol.and not a drop of code to be found...

Posted: Thu Nov 10, 2005 6:16 am
by mhouldridge
Here is the echo statement to output the content which is stored within a database field called message;

<? echo $formVars["message"]; ?>

Posted: Thu Nov 10, 2005 6:17 am
by Charles256
ah.when they're entering the info into the database chances are they'll have to manually type in "<br />" in order to get those line brakes. only way around it is to store the subject in a field, the body in a field, and the sig in a field then put the breaks in when displaying it.

Posted: Thu Nov 10, 2005 6:27 am
by jurriemcflurrie

Code: Select all

<? echo nl2br($formVars["message"]); ?>

Posted: Thu Nov 10, 2005 6:29 am
by Charles256
or you can do that... :: goes and changes his own code. :: :-D