Formatting
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 posted this at 17:47 — 26th September 2005.
He has: 2,145 posts
Joined: Nov 2003
Do you have code somewhere that is stripping out the newline (\n) character?
-Greg
baldrick posted this at 21:32 — 26th September 2005.
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.