Forum Moderators: open
how to store the html format. Example if user want to click hello in bold letter. In database side it will store like this <strong>hello</strong> in another page it will display like <strong>hello</strong> . I am using datatype is varchar(8000). but i am not getting the result as hello in bold letter.
Some languages will render all the dynamic scripting first and then it will compile the HTML. Others will compile the HTML and then perform the dynamic scripting. Once both these things have happened regardless of order it will then send the file to the users' browser.
So when you have HTML being called into the page as a string the compiler may have already rendered the HTML so another argument is required to tell it that the string is not plain text but is text/html content type.
I don't know what language you are using but it usually looks something like this.
string_with_html = "<strong>Title</strong>"
<span content="structure string_with_html" />
The argument "structure" is called before the call to the variable, this tells the compiler that there is more html to render.
An example of it not rendering what should be an HTML tag is this very post.... clearly i have embedded HTML here and this post is living in a DB or some sort of flat file and is being called into this page but it has only been rendered in plain text. An addition argument would be needed to tell this page that the HTML tags in these posts are to be rendered as HTML. Clearly they aren't.
I hope this makes sense. The issue is not how you store it, the issue is how you are calling it into the page.... You are most likely calling it into the page as plain text. You will most likely need an extra argument somewhere to let it know that the text contained in the string is to be rendered as HTML.
Edit for speeling
[edited by: Demaestro at 6:34 pm (utc) on April 19, 2007]