www.webdeveloper.com
Results 1 to 8 of 8

Thread: request.servervariables("auth_user") not working

  1. #1
    Join Date
    Feb 2003
    Location
    Saudi Arabia
    Posts
    38

    Question request.servervariables("auth_user") not working

    Hi guys

    i tried to get the username of the machine.
    response.write request.servervariables("auth_user") is give only empty.
    why its not giving the username?
    what settings i have to give thru the IIS?
    kindly help me in this regarding.

    thanks
    sudhakar

  2. #2
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    You are using asp? Or asp.net?

  3. #3
    Join Date
    Feb 2003
    Location
    Saudi Arabia
    Posts
    38
    I am using ASP

  4. #4
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    I wish I could help you more but I don't know asp classic, but the syntax is very similar to that of asp.net which is what I use, I can take a stab at this maybe . You are trying to get the user name for someone who is logged onto the server, and it is giving you a null value. You are logged onto the machine and have a userid when you test this correct?
    Last edited by PeOfEo; 09-06-2003 at 02:06 AM.

  5. #5
    Join Date
    Sep 2003
    Posts
    78
    I've just had that exact same problem.

    For some reason it wont allow you to response.write() your auth_user variable.
    But it does allow me to use it in logic (if statements etc)

    eg:

    Code:
    <%
       
      Dim user
      user = request.servervariables("AUTH_USER")
    
      If user = Superfly1611 then
        
        response.write("Hey Dude")
      Else
        response.write("Who the hell are you?")
      End If
    
    %>
    Notice that there are no quotation marks around the username... took me a while to figure that one out aswell!

    I don't know if this helps or not but i thought i'd let you know anyhow

    Cheers

    Superfly1611

  6. #6
    Join Date
    Sep 2003
    Posts
    78
    forgot to mention...

    you also need to make sure that your ISS is setup with annonymous access UNchecked and if not already done so NT Challenge/Windows Authentication Checked.

  7. #7
    Join Date
    Nov 2006
    Posts
    1
    I know this is an old thread, but I just wanted to make a note as to why I believe your script here worked:

    Dim user
    user = request.servervariables("AUTH_USER")
    'At this point "user" is "undefined"

    'your comment about having to take the double quotes off of Superfly1611
    'makes me believe that this is what is happening. With Superfly1611 being
    'unquoted, it is acting like yet another variable and is therefore also
    '"undeifned". So when you compare undefined to undefined, it makes it
    'thorugh the TRUE block!!! You can test this theory by putting:

    If user = FGSRGHSDRTHESRHESRTHH then

    'This should still work





    Quote Originally Posted by Superfly1611
    I've just had that exact same problem.

    For some reason it wont allow you to response.write() your auth_user variable.
    But it does allow me to use it in logic (if statements etc)

    eg:

    Code:
    <%
       
      Dim user
      user = request.servervariables("AUTH_USER")
    
      If user = Superfly1611 then
        
        response.write("Hey Dude")
      Else
        response.write("Who the hell are you?")
      End If
    
    %>
    Notice that there are no quotation marks around the username... took me a while to figure that one out aswell!

    I don't know if this helps or not but i thought i'd let you know anyhow

    Cheers

    Superfly1611

  8. #8
    Join Date
    Feb 2007
    Posts
    1
    This should right it out for you

    <%Response.Write(Request.ServerVariables("AUTH_USER"))%>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles