Hi CF Guru's,

I need help! I'm trying to create a new HTML file dynamically generated from
CF.

Here's what works now but it's dirty code and I need your help for something
easier.  Maybe a CF tag or something?

Here's my CF code that creates my HTML file dynamically generated from CF:
----------------------------------------------------------------------------
------------------------------------

<cfset MyString = "">

<cfquery name="GetData" datasource="MyDSN" dbtype="OLEDB">
        SELECT myfield
        FROM mytable
</cfquery>

<cfset MyString = MyString & "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0
Transitional//EN'>">
<cfset MyString = MyString & "<html>">
<cfset MyString = MyString & "<head>">
<cfset MyString = MyString & "<title>test title</title>">
<cfset MyString = MyString & "</head>">
<cfset MyString = MyString & "<body>">

<!--- Loop through records --->
<cfoutput query="GetData">
        <cfset MyString = MyString & "#myfield#<br>">
</cfoutput>

<cfset MyString = MyString & "</body>">
<cfset MyString = MyString & "</html>">

<!--- Create file and overwrite it if it's already there! --->
<cffile action="Write" FILE="c:\myfile.txt" output="#MyString#">

<!--- Confirmation! --->
File Created!




William C. Roberts
The Boeing Company
[EMAIL PROTECTED]
(714) 934-0653 office
(714) 934-1792 fax


------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to