retrieve windows username in php

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default retrieve windows username in php

    Hi,

    I am new to php. Is it possible to find out the windows user name in php ?

    Logon in windows domain with 'user1'. I want to get the username in php in
    my example : user1.

    How do you that ?

    thanks


    Johan den Boer Guest

  2. Similar Questions and Discussions

    1. Obtaining Windows Username
      Hey all, Once again, I find myself requiring your expertise, so I'll say Thank in advance. I was going to try using Kerberos (thanks for the inf...
    2. windows username
      Hi! I'm a real beginner. Sorry if I ask some stuġid questions :-) My problem is: I have more users on my computer. The system is windows 2000/...
    3. Get Windows username on Intranet
      Hi all, My Intranet currently runs fine (on a Linux-based server, with Apache, MySQL and PHP). The mail-form works splendid, except that I like...
    4. Getting windows username
      I am developing an intranet and was wondering, when a user logs on is there a way to get the username of the windows account in asp.net. I have...
    5. Antwort: windows username
      Hi, try to read what "perldoc -f stat" tells you! As being myself a beginner, I haven't tried it yet, just read about it. HTH! Best regards...
  3. #2

    Default Re: retrieve windows username in php


    "Johan den Boer" <me@knoware.nl> wrote in message
    news:vq3lg63h1gkk5c@corp.supernews.com...
    > Hi,
    >
    > I am new to php. Is it possible to find out the windows user name in php ?
    >
    > Logon in windows domain with 'user1'. I want to get the username in php in
    > my example : user1.
    >
    > How do you that ?
    >
    > thanks
    >
    >
    Short answer = NO

    Long answer: PHP is a server side language - it will read headers and form
    data sent by the client browser, but it cannot request the data. I don't
    believe Javascript has access to this information either but I believe
    ActiveX or perhaps ASP *might* give you this information...

    To get a rough idea of what information PHP does read from a client web
    browser, write the following simple script in to a file and visit it with
    your web browser

    <?
    phpinfo();
    ?>

    Note: Different browsers deliver different headers so you cannot rely that
    all the information you see in phpinfo() will be avialable every time...


    Randell D. Guest

  4. #3

    Default Re: retrieve windows username in php

    Johan den Boer wrote:
    > Hi,
    >
    > I am new to php. Is it possible to find out the windows user name in php ?
    >
    > Logon in windows domain with 'user1'. I want to get the username in php in
    > my example : user1.
    >
    > How do you that ?
    If you mean client-side then no, not with PHP. That kind of information
    is not transmitted with the HTTP headers.

    And I don't know what it would good for on the server-side, since it
    would most probably be the same all the time.

    Daniel Bengs Guest

  5. #4

    Default Re: retrieve windows username in php

    Johan den Boer <me@knoware.nl> wrote:
    > I am new to php. Is it possible to find out the windows user name in php ?
    >
    > Logon in windows domain with 'user1'. I want to get the username in php in
    > my example : user1.
    Hi Johan,

    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
    though.

    A good start is generally having a phpinfo() running to check what headers &
    information the browser sends to the server.

    JOn
    Jon Kraft Guest

  6. #5

    Default Re: retrieve windows username in php

    Johan den Boer wrote:
    > Hi,
    >
    > I am new to php. Is it possible to find out the windows user name in php ?
    >
    > Logon in windows domain with 'user1'. I want to get the username in php in
    > my example : user1.
    To do this you need to add an extra module to Apache (assuming Apache
    not IIS). This will do a lookup on the domain controller to work out who
    the user is.

    [url]http://modntlm.sourceforge.net/[/url]

    Kevin Thorpe Guest

  7. #6

    Default Re: retrieve windows username in php

    Carved in mystic runes upon the very living rock, the last words of
    Johan den Boer of comp.lang.php make plain:
    > Logon in windows domain with 'user1'. I want to get the username in
    > php in my example : user1.
    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.

    --
    Alan Little
    Phorm PHP Form Processor
    [url]http://www.phorm.com/[/url]
    Alan Little Guest

  8. #7

    Default Re: retrieve windows username in php

    In article <T%mob.229825$pl3.105712@pd7tw3no>, Randell D.'s output was...
    >
    >
    > Long answer: PHP is a server side language - it will read headers and form
    > data sent by the client browser, but it cannot request the data. I don't
    > believe Javascript has access to this information either but I believe
    > ActiveX or perhaps ASP *might* give you this information...
    Snip

    Not sure if this is patched yet, but.......

    [url]http://www.insecure.org/sploits/NT.NTLM.auto-authentication.html[/url]

    may be of some use to you. Plug in a sniffer and see what's happening...

    Also, stepping away from PHP, and into some client-side scripting:

    [url]http://beta.experts-exchange.com/Web/Web_Languages/Q_20717958.html[/url]

    might help you out.
    Eto Demerzel Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139