Getting Windows Network login username using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • greatjuli
    New Member
    • Jul 2007
    • 7

    Getting Windows Network login username using PHP

    Hi,
    I am trying to develop intranet for my company as the new web admin. When users log in to the network with their username and password, they do not need to login again into the intranet; a single sign-on situation. The intranet will be PHP-MySql on Apache driven. Please does anyone know how i can get the username they used to log on to windows (Network) in my PHP scripts on the intranet. Thank you.
    Last edited by greatjuli; Jul 17 '08, 11:59 AM. Reason: more details
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    I don't think this is possible using PHP, because PHP is an internet language which feeds information to browsers and gets information from online databases.

    I think that ASP can do what you are after and so maybe there is a way to get username and passwords using ASP and then hand it over to a PHP login script?

    Comment

    • greatjuli
      New Member
      • Jul 2007
      • 7

      #3
      Thank you! How is this ASP-PHP handover done? can the PHP script reside in ASP file? I have seen a segment of code in ASP where windows username was fetched but dont know how to pass this to PHP.

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        Mate, I wish I could help, but I have no experience with ASP. I do know that ASP can interact with databases, so I have a feeling that if they can't directly handover variables you might need a middleman like MySQL.

        I have tried to get variables to pass between javascript and PHP before and eventually gave up, but there has to be help out there. Maybe ask on the ASP.NET forums in here? If you do find a solution, I would really appreciate it if you could post it back here for me and others to learn as well.

        Maybe a better php programmer with some ASP/PHP experience will see this and be able to help, so check again in a little while.

        Comment

        • nashruddin
          New Member
          • Jun 2008
          • 25

          #5
          Get the login username in windows using PHP:

          Code:
          <?php
          $username = getenv('USERNAME');
          ?>

          Comment

          • gaxman
            New Member
            • Jul 2008
            • 13

            #6
            that script doesnt work?

            Comment

            Working...