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 / Advanced Techniques / August 2005



Tip: Looking for answers? Try searching our database.

cffile

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kt03 - 30 Aug 2005 17:08 GMT
I have the form for user to fill out and generated the syntax based on what
they enter.  I am using this code to generate the syntax in text format.
<cffile action="append" file="#getdirectoryfrompath(path_translated)#
Script.txt"
output=?cn=fname m lname, ou=CT,c=US, Action:action?

 In the text file, I want to able to display the first added record at the
bottom and last added record at the top.  The example below is how my text file
look like
A:
cn=RICHARD J COLES,
ou=CT,c=US,
Action: Add

dn:cn=Mike Cole,
ou=CS, c=US
changetype: Del

Richard has been added to the file before Mike.  How can I convert the order
as B?
B:
dn:cn=Mike Cole,
ou=CS,  c=US,
Action: Del

cn=RICHARD J COLES,
ou=CT, ou=Local, ou=IT, c=US
changetype: Add

Thanks
philh - 30 Aug 2005 17:41 GMT
kt03,

Read the script file into a variable.  Concatenate what the user entered with
that variable, and write it back to the script file.

<cfset enteredstuff="#whattheyentered#">
<cffile action="READ" file="#getdirectoryfrompath(path_translated)#
Script.txt" variable="filetext">
<cfset filetext=enteredstuff&chr(13)&filetext>
<cffile action="WRITE" file="#getdirectoryfrompath(path_translated)#
Script.txt" output="#filetext#" NAMECONFLICT="OVERWRITE">

HTH,
kt03 - 30 Aug 2005 18:42 GMT
HTH,

I don't really get your point.  Would you more specific or even an example?
The user enters name and selected the action.  But ou and c are hardcode.

thanks
 
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



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