Simple message interface

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Simple message interface

Post 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?
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

lol.and not a drop of code to be found...
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

Here is the echo statement to output the content which is stored within a database field called message;

<? echo $formVars["message"]; ?>
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post 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.
User avatar
jurriemcflurrie
Forum Commoner
Posts: 61
Joined: Wed Jul 06, 2005 7:14 am
Location: Den Haag, the Netherlands

Post by jurriemcflurrie »

Code: Select all

<? echo nl2br($formVars["message"]); ?>
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

or you can do that... :: goes and changes his own code. :: :-D
Post Reply