Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

append to text file- server side

Status
Not open for further replies.

ChuckG

MIS
Feb 28, 2001
211
US
Hi, I've done quite a bit with ASP, but never really have messed with Javascript.

I have an existing site that's using Server Side Java Script, I need to get one of the pages to write a line to a text file on the server when run.

Basicly what I'm doing is, when someone logs on via the website, I want to append a line to a text file that says

"<user> logged on via web"

That's it. (would be nice if the file doesn't exisit, that it auto-creates it).

Any suggestions on where to start?

Thanks
ChuckG



ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight-club.org
 
Try faq216-5305 as a starting point... the FSO should be available server-side as well, although you might need slightly different syntax to instantiate it.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
I use Javascript/JScript with ASP, have a function that handles that:
Code:
var read=1, write=2, append=8, ascii=-2;
var filesys=Server.CreateObject('Scripting.FileSystemObject');

function appendfile(onestring, filename)
{
var txtfile=filesys.OpenTextFile(filename, append, ascii);
txtfile.WriteLine(onestring);
txtfile.Close();
}

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top