Calling CodeFusion Code from a Data Source

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Calling CodeFusion Code From a Data Source

    :confused; Right now, I'm storing HTML code in a field, calling the field into
    my page with <cfoutput>. This works like a charm. I would like to do the same
    with my ColdFusion code, (if user clicks Home, the stored code executes in the
    content section of the page) but it doesn't seem to work.

    I want to set up 1 page for most of our content. I want to call the code from
    my table, and have it run. Is there a way to do this? My hosting company is
    using ColdFusion 7.


    msergel Guest

  2. Similar Questions and Discussions

    1. Why doesn't the Code Completion occur in FlexBuilder IDEwhen source code is in an external file?
      I am seperating my .as from the MXML by using the following in my file.mxml: <mx:Script source="file.as"> When I edit file.as, the code...
    2. ASP Source Code
      Dear Friends We have Developed an Web Application by ASP. We are looking for a Technical Company for Our Source Code Testing...
    3. SCO, Open Source and the Un*x source code
      On Sat, Jul 19, 2003 at 04:51:08PM +0000, tony@aplawrence.com wrote: .... Isn't SCO claiming that they own all the Unix IP in the world :-). ...
    4. Get source code
      Hi. I'd like to get the source code from a web site (I mean the code we can watch once we click on the "view source" option in the IE). Is it...
    5. Security problem with Managed Code calling Unmanaged Code in a Web Page
      Hello, I have a web page which contains an ActiveX control (unmanaged) and a Windows Forms User Control (managed). Both reside on a web page and...
  3. #2

    Default Re: Calling CodeFusion Code From a Data Source

    This is a bad idea. Why are you trying to build your website like this?
    s0mus Guest

  4. #3

    Default Calling CodeFusion Code from a Data Source

    :confused; I can store plain HTML in my table, call it and have it display. I
    would like to do the same thing with my ColdFusion coding, but it seems to get
    confused. Is there something I can do to have the CF code in my table execute?
    This would make my website much simpler. If the Home link is clicked, this code
    runs in the content section. If links is clicked, this code runs.... A one page
    website instead of over 100 pages.

    msergel Guest

  5. #4

    Default Re: Calling CodeFusion Code from a Data Source


    "msergel" <webforumsuser@macromedia.com> schrieb im Newsbeitrag
    news:d2m9bm$8vp$1@forums.macromedia.com...
    > :confused; I can store plain HTML in my table, call it and have it
    display. I
    > would like to do the same thing with my ColdFusion coding, but it seems to
    get
    > confused. Is there something I can do to have the CF code in my table
    execute?
    > This would make my website much simpler. If the Home link is clicked, this
    code
    > runs in the content section. If links is clicked, this code runs.... A one
    page
    > website instead of over 100 pages.
    Hi,

    have a look at the evaluate() function. This will execute a String
    containing a ColdFusion Statement. Your DB-Content is only a String - you
    can execute it. But: Your App will get much slower cause the Templates you
    store in the Database cannot really be cached. (Java Files, MX6 and above).

    :-)

    cu


    Simon Dallmair Guest

  6. #5

    Default Re: Calling CodeFusion Code From a Data Source

    Thank you. That was my initial plan, but that will still involve having a 100
    little cfcs or cfms. Whereas if I could store the code in a datafile, I have 1
    table to update/reference. I was hoping there was a funtion or tag out there
    would have the code run when it's called.

    msergel Guest

  7. #6

    Default Re: Calling CodeFusion Code From a Data Source

    See the 'evaluate' function
    gregsohl Guest

  8. #7

    Default Re: Calling CodeFusion Code from a Data Source

    If I understand you correctly, the following is the sequence of steps that
    occur:

    1. Your browser requests go.cfm from the Web server.
    2. The Web server sees the .cfm file extension and invokes the ColdFusion
    server.
    3. The ColdFusion server processes go.cfm, retrieving a ColdFusion page from
    the database.

    Are you expecting ColdFusion to then execute the data it just retrieved?
    Don't think so.



    jdeline Guest

  9. #8

    Default Re: Calling CodeFusion Code from a Data Source

    The reason you can do it in HTML is because your browser knows how to handle
    HTML. In Coldfusion the CF server executes the CF code and sends a page that
    displays
    properly in your browser. What you would have to do is read the CF code from
    the database,
    write it to a .cfm template, then cfinclude that template is the template that
    is currently
    executing.



    OldCFer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139