I addition to my post I would like to point out how much of a security risk
it would be to be able to do this.

Anyone could write any code and insert it into your database and run it.

BAAADDD

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Steve Onnis
Sent: Saturday, 5 April 2003 11:10 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: outputing cf code


eugene

Cant be done sorry.  Once the data has come from the data base its aready
been procced and CF can not re parse it to be like cf.

That is what I wrote before I thought about it.

This is one way you can do it

--------------------------------------
In your main CF template

<cfset hello = "Steve">
<cfsavecontent variable="dummy_DB_Var">
my name is &lt;cfoutput&gt;#hello#&lt;/cfoutput&gt;
</cfsavecontent>

<cf_outputDatabaseData data="#dummy_DB_Var#">
--------------------------------------

--------------------------------------
Code for dummyDatabaseData.cfm

<!--- Set default --->
<cfparam name="Attributes.Data" default="">

<!--- Grab all the local scop variables from the calling page and set them
in this local scope --->
<cfloop collection="#caller.Variables#" item="i">
        <cfset "#i#" = caller[i]>
</cfloop>

<cfset thisData = Replace(Attributes.Data,"&lt;","<","ALL")>
<cfset thisData = Replace(thisData,"&gt;",">","ALL")>

<!--- Write temp file --->
<cffile action="WRITE" output="<cfoutput>#thisData#</cfoutput>"
file="#ExpandPath(".")#\#CFTOKEN#tempVar.cfm">
<!--- Include the file so it can be processed --->
<cfoutput><cfinclude template="#CFTOKEN#tempVar.cfm"></cfoutput>
<!--- Clean up the file --->
<cffile action="DELETE" file="#ExpandPath(".")#\#CFTOKEN#tempVar.cfm">
--------------------------------------

Basicaly we get the data from the database, save it to a temp file then just
process it like any other cf template.

Bit of a hack but it works.  But my first statement still stands.  When the
data is received from the db server, its processed, and the only way to do
what you want to do it to get cf to reprocess the information, eg via a
cfinclude for similar.

Regards
Steve Onnis
Domain Concept Designs

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Eugene
Sent: Saturday, 5 April 2003 4:43 AM
To: CFAussie Mailing List
Subject: [cfaussie] outputing cf code


I use a wysiwyg editor in my site to create pages. The code from the
wysiwyg is stored in the database and out put using <cfoutput></cfoutput>

My problem is that I want to put cf code in the wysiwyg editor, store it
in the database and have that out put, but it doesn't work.

Does anyone know how to do this?

eugene

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to