Formatting

They have: 11 posts

Joined: Jul 2005

Hi,

I am building a guestbook usin PHP/Mysql and I'm wondering how to set up the forms so that they keep the text formatting when I display the info from the database.

Example:

Hi,

This is my guestbook entry,

Onoff

as opposed to:

Hi,This is my guestbook entry,Onoff

Cheers!

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

Do you have code somewhere that is stripping out the newline (\n) character?

-Greg

He has: 388 posts

Joined: Apr 2005

This snippet of cod will change line breaks to tags

$message = nl2br($row[message]);

I think thats what your looking for.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.