<%= Request.ServerVariables("LOGON_USER")%�

Results 1 to 8 of 8

Thread: <%= Request.ServerVariables("LOGON_USER")%�

  1. #1
    skibum Guest

    Default <%= Request.ServerVariables("LOGON_USER")%�

    I am trying to track the users logging on to our intranet site. I put &#060;%= Request.ServerVariables("LOGON_USER")%&#062;<BR> at the top of my ASP page, but when I go to IIS to check for a log there isn&#039;t one. I checked both default web site and the actual web site. <BR><BR>Do I have to have a respons.write statement to a txt?<BR><BR>Does anyone know how to write this info out to a log. Thank you.

  2. #2
    Reggie Guest

    Default RE: <%= Request.ServerVariables(

    Yes, you have to make the log yourself. Either use FSO and write it to a simple text file or INSERT it in an Access database.

  3. #3
    skibum Guest

    Default RE: <%= Request.ServerVariables(

    Thanks for your help. I&#039;m still kind of new at this... <BR>I added the following:<BR>&#060;OBJECT RUNAT=server PROGID=Scripting.FileSystemObject id=objFileSys&#062;<BR>&#060;/OBJECT&#062;<BR>Set objTextStream = objFileSys.CreateTextFile(USER.TXT, [Overwrite})<BR>but the statement appears on my page... I&#039;m not exactly sure what to do.

  4. #4
    Reggie Guest

    Default RE: <%= Request.ServerVariables(

    Looks like you&#039;re starting out with the right idea, but here&#039;s exactly what you&#039;ll need. Either create the file manually or use this first FSO code (only need to run this once to create the folder):<BR><BR>&#060;%<BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>Set f1 = fso.CreateTextFile("c: estdir estfile.txt", True)<BR>&#039;make sure that directory already exists or you might get an error<BR>%&#062;<BR><BR>And once the folder is completed you want to run the following code every time:<BR><BR>&#060;%<BR>Set fso = Server.CreateObject("Scripting.FileSystemObject")< BR><BR>strUsername = Request.servervariables("logon_user")<BR>path = "c: estdir estfile.txt"<BR>ForAppending = 8<BR><BR>set file = fso.opentextfile(path, ForAppending, TRUE)<BR><BR>file.write(strUsername) & vbcrlf<BR><BR>file.close<BR>set file = nothing<BR>set fso = nothing<BR>%&#062;

  5. #5
    skibum Guest

    Default Thanks for your help,

    Thanks for your help, I&#039;ll try this out and let you know what happened!

  6. #6
    skibum Guest

    Default I get an error path not found, yet I created the c

    I typed the following:<BR>&#060;%<BR>Set fso = CreateObject("Scripting.FileSystemObject") <BR>Set f1 = fso.CreateTextFile("c: estdir estfile.txt", True) <BR>%&#062;<BR> <BR>&#060;%Set fso = Server.CreateObject("Scripting.FileSystemObject") <BR><BR>strUsername = Request.ServerVariables("LOGON_USER")<BR>path = "c: estdir estfile.txt"<BR>ForAppending = 8 <BR><BR>set file = fso.OpenTextFile(path, ForAppending, TRUE) <BR><BR>File.Write(strUsername) & vbcrlf <BR><BR>file.close <BR>set file = nothing <BR>set fso = nothing <BR>%&#062;<BR><BR>and created the testdir in root. I get an error refering to line<BR>with <BR>Set f1 = fso.CreateTextFile("c: estdir estfile.txt", True) <BR><BR>did I type something incorrectly?

  7. #7
    Reggie Guest

    Default RE: I get an error path not found, yet I created t

    That&#039;s probably a permissions error. You&#039;ll need to change the path to where the website is located like C:wwwrootinetpubyourwebsiteisprobablyheresomewhere . Unfortunately, I know nothing about permission and they always cause me problems. You need to let the anonymous internet user have write permissions to the directory/file you are dealing with.

  8. #8
    skibum Guest

    Default Great, I can do the permissions thing, that's

    Again, thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts