Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Flash Integration / September 2004



Tip: Looking for answers? Try searching our database.

need to write to a txt file from coldfusion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fiuOY - 29 Sep 2004 16:14 GMT
Hello,

How can I write to a txt file if an IF stament is true?  All I need the txt
file to have is one line, which will be read by a flash file.
some thing like this:

<cfif #answer# EQ OK>
   writeToTxtFile("&asnwer=OK")
<cfelse>
  writeToTxtFile("&answer=NotOK")

Thanks in advance
dr_bozak - 29 Sep 2004 16:42 GMT
here ya go ...
straight outta cf docs ...
see CFFILE Tag for more options ....

<!---- get current directory as full path where text file will be --->
<!--- this is just to get the full path. you could set it to whereever your
file is --->

<cfset filepath = GetDirectoryFromPath(GetBaseTemplatePath())>

<cfif #answer# EQ OK>
<cffile action = "append" file = "#filepath#/textfile.txt" output =
"&answer=OK">

<cfelse>

<cffile action = "append" file = "#filepath#/textfile.txt" output =
"&answer=NotOK">

</cfif>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.