Results 1 to 3 of 3

 

Thread: Formatting and storing text?

  1. #1
    Member

    Status
    Offline
    Join Date
    Jan 2004
    Location
    UK
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Ok,

    So I have a php written site where someone can enter text into a textarea field..

    ... but when I want to display it again obviously all the newlines etc have been stripped out and the users can't change the colour or make the text bold....can anyone help??

    Again the users writing the text want an easy to use interface (sorry to say but a bit like hotmail) and I don't want the fancy things
    Holiday Villa In<br>
    <font size=2>If it moves, kick it. If it doesn't move, kick it till it moves and hen kick it because it moved</font>

  2. #2
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    well the line breaks are easy, just do a string replace and replace "\n" with "<br>"

    making it bold etc is a bit more tricky without doing like [ b] [ /b] to tell the script. if anyone has an easy solution id be keen to hear as I use these in various places too.

    Maybe a bit of javascript that where you can highlight a bit of text in the box and click a B and it goes bold, or just puts <b> </b> round it or something...
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  3. #3
    Member

    Status
    Offline
    Join Date
    Jan 2004
    Location
    UK
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Morley,

    At least their text will be on the right lines!

    NM.
    Holiday Villa In<br>
    <font size=2>If it moves, kick it. If it doesn't move, kick it till it moves and hen kick it because it moved</font>



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2