Copy link to clipboard
Copied
Hi,
In my oracle database I have a column which contains html tags... How can I populate the html using coldfusion...
So in my Conn_Html table I have HTML_TXT column which has data something like the following:
server/test_html/txt/12345test.html...
Any help is appreciated...
<a href="#OracleQuery.htmlText#">Oracle Link</a>
OR
<cffile action="read" file="#expandPath(OracleQuery.htmlText#" variable="fileData">
<cfoutput>#fileData#<cfoutput>
OR
<cfcontent type="text/html" file="#expandPath(OracleQuery.htmlText)#">
Are three possible ways I could think of accessing a file from a link stored in a database table retreived with a <cfquery...> tag.
P.S. Note I did not check my syntax and I don't use some of these tags on a daily bases, so I may have missnamed a parameter here or
...Copy link to clipboard
Copied
Your question is not clear. Your example does not contain any html tags. Is that an html file you want to be able to read?
Copy link to clipboard
Copied
Yes, it is an html file. I'm sorry about the confusion, how can I populate this file using CF...
Copy link to clipboard
Copied
Not sure why would want to....
But cfml's <cffile....> tag is perfectly capable of writing any data you like, including HTML formated data, to a file.
If that is not what you are trying to do, you need to be much clearer about your questin.
Copy link to clipboard
Copied
ok, I'll try to explain a bit more...
In my data base I have link to a HTML page...
So I my oracle database I have a column which contains html links like (server/test_html/txt/12345test.html)...
With the following query:
<cfquery datasource="Oracle" name="Orcale Query">
Select HTML_TXT
From Conn_Html
</cfquery>
when I run this query My result shows the following:
server/test_html/txt/12345test.html
But i want to see what is contained in this html file... How can i populate what is in that html...
Thanks...
Copy link to clipboard
Copied
<a href="#OracleQuery.htmlText#">Oracle Link</a>
OR
<cffile action="read" file="#expandPath(OracleQuery.htmlText#" variable="fileData">
<cfoutput>#fileData#<cfoutput>
OR
<cfcontent type="text/html" file="#expandPath(OracleQuery.htmlText)#">
Are three possible ways I could think of accessing a file from a link stored in a database table retreived with a <cfquery...> tag.
P.S. Note I did not check my syntax and I don't use some of these tags on a daily bases, so I may have missnamed a parameter here or there. Look them up in the documentation.
Copy link to clipboard
Copied
You can use cflocation to navigate to the page to check. for example
<cfset x="server/text_html/text/12345test.html"><cfset x="server/text_html/text/12345test.html">
<cflocation url="#x#">
or
use a javascript to open the content in new window.
<cfoutput> <script> window.open('#x#','popwin','scrollbars=yes/no'); </script> </cfoutput>
Copy link to clipboard
Copied
Also, not exactly sure what you're trying to accomplish, but if you would like the contents of your HTML page displayed on your CFM page, you can import the content using the <cfinclude> tag.