• 0

replace line breaks w/<br>


Question

Hey guys, just wondering if any of you have any ideas how I could do this quickly and easily.

I'll be taking input from a form, a textarea, and placing it into a db, then extracting it later into a list. I want it to keep whatever line breaks the typer places in it when it's put into the db and extracted back out into html. Just like a forum does.

Whats the easiest way to do this in ASP/VBScript?

I'd prefer to convert all line breaks to <br>'s on the server side before I place the text in the db, that way it'll be preformatted when I pull a list and I won't have to fiddle with the output.

Thanks for any help.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

But I tend to store data unformatted and format it while rendering. This then allows you to possibly maniplulate it in different ways later.

Link to comment
Share on other sites

  • 0
at the expense of the rendering speed...

Yeah, look at VB and IPB. VB stores into the DB without parsing, and renders it with parsing. IPB stores parsed data, and renders it without having to do any excessive processing :)

Link to comment
Share on other sites

  • 0

yeah that makes a lot more sense to me, you only put it into the db once and do the parsing then, instead of doing it when you pull it out, which the server will have to do over and over and over... greatly adding to server load. I can see the benefits of both, but in a BB type app, it seems it would be worth it (load wise) to format it before it goes into the db.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.