Hello,
I want to save html codes or any language code in my database.
For instance, am saving the text below in the database :
<!--- STRIP OUT ALL HTML --->
<cfset test = StripToHTML.stripHtml(VARIABLES.text, "all")>
<cfdump var="#test#"><br/>
<!--- STRIP OUT IMG, B, AND EM TAGS --->
<cfset test1 = StripToHTML.stripHtml(VARIABLES.text, "img,tag,false;b,tag,true;em,content,true")>
<cfdump var="#test1#"><br/>
When it has been saved in the database, it's like follows :
<!--- STRIP OUT ALL HTML --->
<cfset test = StripToHTML.stripHtml(VARIABLES.text, "all")>
<cfdump var="#test#"><br/>
<!--- STRIP OUT IMG, B, AND EM TAGS --->
<cfset test1 = StripToHTML.stripHtml(VARIABLES.text, "img,tag,false;b,tag,true;em,content,true")>
<cfdump var="#test1#"><br/>
And when I am displaying it on a page, it displayed as above.
Someone can tell me how to save the codes in the correct format in the database and how to make them display correctly ?
I am using MSSQL 2008 for the database.
well I have used the function safetext but unfortunately its not good.
I have test it with the test below :
Hello V/s <b>Hello</b>
and the result after using safetext qive me the result :
Hello V/s <b>Hello</b>
I have already do a rereplace function to replace the < and > with <> but this would appear like :
Hello V/s Hello
Instead of showing the tag b , it execute the html tag.
I don't know how to make any codes appear on a page. ![]()
Could anyone please help me ?
North America
Europe, Middle East and Africa
Asia Pacific