Text to HTML in database

Results 1 to 3 of 3

Thread: Text to HTML in database

  1. #1
    Join Date
    Dec 1969
    Posts
    23

    Default Text to HTML in database

    Hi,<BR><BR>I was wondering if anyone knows of a tool that converts text to HTML when it is entered into a database via an ASP page.<BR><BR>Basically, I have developed a web-based front end for editing a database, and want people to be able to add a few paragraphs in the textbox, and have that converted to HTML when placed in the database.<BR><BR>Any help would be greatly appreciated.<BR><BR>Sami

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Text to HTML in database

    What, exactly, needs to be converted? It sounds like you just need to add:<BR><BR>&#060;HTML&#062;&#060;BODY&#062;<BR><B R>at the top and<BR><BR>&#060;/BODY&#062;&#060;/HTML&#062;<BR><BR>at the bottom. Then, for each two carraige returns, put in a P tag and a BR tag for any single carraige return. You can do this with ASP. Before you submit your data, do:<BR><BR>&#039this is the value from the text box<BR>Dim strTextBox<BR>strTextBox = Request("TextBoxValue")<BR><BR>&#039Put the header and footer on<BR>strTextBox = "&#060;HTML&#062;&#060;BODY&#062;" & strTextBox & "&#060;/BODY&#062;&#060;/HTML&#062;"<BR><BR>&#039Now, put &#060;P&#062; tags in place of vbCrLf & vbCrLf<BR>strTextBox = Replace(strTextBox, vbCrLf & vbCrLf, "&#060;P&#062;")<BR><BR>&#039Now put BR tags in place of vbCrLf<BR>&#039NOTE, the messageboard doesn&#039t display BR tags, so I will call it an RB tag, but I mean BR<BR>strTextBox = Replace(strTextBox, vbCrLf, "&#060;RB&#062;")<BR><BR>Then you can slap that into the database and you&#039re off and running! Happy Programming! :)<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    23

    Default RE: Text to HTML in database

    Hi Scott,<BR><BR>Thanks for your suggestion. That should solve my problem.<BR><BR>Sami

Posting Permissions

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