Jump to content


Coding own WYSIWYG news/admin panel.

  • Please log in to reply
1 reply to this topic

#1 eddorey2k3

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 26 May 2006 - 10:25 PM


Ok. So i've coded myself a nice little script to update the news section of my website. Works like a charm. However, the text area that you input the actual content of the news isn't all that smart (As you'd expect, it's just a text area), so all formatting has to be entered manually (Paragraphs, breaks, etc etc).

What I'm trying to do, is now that the news panel is finished, is find a way of making it so any breaks in the content get auto formatted into the MySQL string that will get input into the database.

I hope that makes sense, but as an example, if I were to do:
Todays news is
That I like cheese.

At the moment, it would come out as "Todays news is That I like cheese." For this reason, I'd need to put the suitable <br>'s in. What I want, is something to recognise it's on 2 lines, and auto insert the <br>'s and <p>.

Any ideas?

#2 poirot

  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 26 May 2006 - 10:35 PM

For new lines, you can use nl2br()
[a href=\"http://www.php.net/nl2br\" target=\"_blank\"]http://www.php.net/nl2br[/a]
~ D Kuang

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users