Skip to main content
Known Participant
August 6, 2009
Answered

connect to html tags using CF

  • August 6, 2009
  • 3 replies
  • 1262 views

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

    This topic has been closed for replies.
    Correct answer ilssac

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


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

    3 replies

    Inspiring
    August 11, 2009

    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.

    Participating Frequently
    August 8, 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>

    Inspiring
    August 6, 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?

    RosieGpAuthor
    Known Participant
    August 6, 2009

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

    ilssac
    Inspiring
    August 6, 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.