Results 1 to 5 of 5

Thread: Problem with text stored in database

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Croatia
    Posts
    52
    I have problem with text written in textarea like this and then stored into database. When I store text like this:

    This is text I'm inserting into
    database.
    I'm using "new lines(enter)" which I can't display on my web page.


    On my web page It looks like this:

    This is text I'm inserting into database. I'm using "new lines(enter)" which I can't display on my web page.

    What can I do to awoid this?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Either:

    a) When storing the text in the database, replace all newlines with "<br>"

    b) On the page, enclose the text in <pre></pre> tags.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Croatia
    Posts
    52

    How do I replace newline with <br>

    How can I replace newline with "<br>" if I'm inserting text into textarea box and then inserting into database?

  4. #4
    Guest
    Code:
    sHTMLText = Replace(sPlainText, vbcrlf, "<br>" & vbcrlf)

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Croatia
    Posts
    52

    Thanks

    Thanks. It works with <pre> </pre>

Posting Permissions

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



Click Here to Expand Forum to Full Width