Jump to content


html + php

  • Please log in to reply
2 replies to this topic

#1 chriscloyd

  • Members
  • PipPipPip
  • Advanced Member
  • 489 posts
  • LocationArizona

Posted 29 May 2006 - 09:42 PM

Okay im making a news post script it all works and enters it into the database when it displays the text it doenst come out how i put it in there unless i use html in it like

<strong> HELLO </strong><br>
How are you guys doing today?<br>

thats what it comes out as if i do it that way but i just want to be able to hit enter with out putting html into it and haveing it add the html any easy way of doing this?

44 bugs in my java code
44 bugs in my java code
Fix 1 bug, and complie again
122 bugs in my java code

#2 bobleny

  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 29 May 2006 - 09:56 PM

This is the only code that I know. Id bet there are better ones but...

thats what I use. You will have to addapt it to your own need.

$message = nl2br(mysql_result($result,"message"));


$X = nl2br();
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#3 SharkBait

  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 29 May 2006 - 10:05 PM

nl2br = New Line 2 Break :)

You'll still have to do your text formatting tags like <strong> and such, but at least this way it will read the database entry with cariage returns :)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users