Jump to content


Photo

field types


  • Please log in to reply
3 replies to this topic

#1 supanoob

supanoob
  • Members
  • PipPipPip
  • Advanced Member
  • 342 posts

Posted 17 June 2006 - 04:17 PM

well i have made my own forum and for the time being my field type for my post body is "TEXT" and i have noticed that when i press enter it doesnt do it, it doesnt make the text on a new line. and i was wondering if there was a different field type that i could use, that would still allow me to use html to format the text.

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 17 June 2006 - 04:23 PM

when you retrieve data from your database table, use the nl2br() function to get those 'new lines' converted to html <br/> tags.
echo nl2br($message);

Legend has it that reading the manual never killed anyone.
My site

#3 supanoob

supanoob
  • Members
  • PipPipPip
  • Advanced Member
  • 342 posts

Posted 17 June 2006 - 04:30 PM

that didnt work :s

nl2br($replybody);

it echoed the nl2br(); part aswell as my message body in the middle

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 17 June 2006 - 05:13 PM

[!--quoteo(post=385014:date=Jun 17 2006, 12:30 PM:name=supanoob)--][div class=\'quotetop\']QUOTE(supanoob @ Jun 17 2006, 12:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
that didnt work :s
[/quote]
nl2br() always converts 'newlines' to html br tags. Maybe a peek at some of your code would assist in understanding what this "didnt work" is all about.

Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users