Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

connect to html tags using CF

New Here ,
Aug 06, 2009 Aug 06, 2009

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...

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Aug 06, 2009 Aug 06, 2009

<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

...
Translate
LEGEND ,
Aug 06, 2009 Aug 06, 2009

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 06, 2009 Aug 06, 2009

Yes, it is an html file. I'm sorry about the confusion, how can I populate this file using CF...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 06, 2009 Aug 06, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 06, 2009 Aug 06, 2009

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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 06, 2009 Aug 06, 2009

<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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 07, 2009 Aug 07, 2009

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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 11, 2009 Aug 11, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources