getting username of currently logged user on client machine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sgawas01
    New Member
    • Feb 2008
    • 4

    #1

    getting username of currently logged user on client machine

    i want the username of currently logged in user on client machine. want to use it for intranet authentication.

    i dont want my application to show any popup asking for username and password. it should automatically use the windows username.

    can anybody help me out..

    php

    its urgent
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    PHP is a server side language - it will read headers and form
    data sent by the client browser, but it cannot request the data. That kind of information is not transmitted with the HTTP headers.

    If the web server is in the same domain, i.e. intranet, try echoing
    $_SERVER['LOGON_USER'] and $_SERVER['AUTH_USER']. Might only work with IE.

    You might have more success asking in a Windows and/or IIS forum, as to how
    you can get the user name into the server environment.

    Ronald

    Comment

    • aktar
      New Member
      • Jul 2006
      • 105

      #3
      There are alternative ways of achieving what you're after:

      You will need to ask the users (user) name by way of form, js popup etc....

      And then...

      Store a cookie in the users computer.
      And on subsequent visit, just retrieve that cookie.


      OR

      Store the details on your server, along with the users IP address so that on subsequent visit the user can be identified by IP address.
      This method work only where users IP does not change

      Comment

      Working...