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 server file - Javascript newb

Status
Not open for further replies.

ChuckG

MIS
Feb 28, 2001
211
US
Hi all,

First, let me appologize, I have NEVER worked with Javascript. Since this BBS I'm running utilizes it, I'm going to have to start learning, but in the mean time I'm hoping someone might be able to help me with a project I'm trying to get working.

I've got a logon page for my BBS that's using Server Side Javascript, I'm trying to figure out how to make it so when someone logs on to the BBS via this SSJS page, it will append the username and some text to a file on the server.

Here's the ssjs file.

if(user.number==0 || user.number==system.matchuser('Guest')) {
http_reply.status='401 Permission Denied';
http_reply.header["WWW-Authenticate"]='Basic realm="'+system.name+'"';
}
else {
// Note: A 302 here would mean the index would be displayed as "/login.ssjs"
// That is to say, it would display the index AS login.ssjs.
// http_reply.status='302 Found';
http_reply.status='307 Temporary Redirect';
}
http_reply.header.location='/index.ssjs';
http_reply.header.pragma='no-cache';
http_reply.header.expires='0';
http_reply.header['cache-control']='must-revalidate';

writeln('<html>');
writeln('<head>');
writeln('</head>');
writeln('<body>Logging in to <a href="/">'+system.name+'</a></body>');
writeln('</html>');



All I'm trying to have it do, is append

<user> logged on via web.

to a file on the server, if they actually authenticate. I can read the file anywhere on the server, and I'm not wanting to include password or any other "personal" data, just username.

Anyone have any suggestions?
Thanks
ChuckG



ChuckG
-=-=-=-
Midnight Club BBS
telnet midnight-club.org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top