How PHP Gets the login user name for the current Windows system

Source: Internet
Author: User
Tags ldap
Is there any way for PHP to get the login user name of the current Windows system? It is best to have verified the success of the code, previously found on the internet is the same piece of code, is said to be written by the French, some direct copy and paste, some good, to translate a point, but all bad use, hope to have a successful people to help


Reply to discussion (solution)

Can be extended via PHP_LDAP

Can be extended via PHP_LDAP



Can you elaborate?

I don't have an LDAP service started on my network, so I'm not going to elaborate

I don't have an LDAP service started on my network, so I'm not going to elaborate



Brother.. It is not good to say a word, not to mention the same. You said LDAP I Baidu a bit, it seems that I did not find LDAP can get the current Windows system login user name:

I don't have an LDAP service started on my network, so I'm not going to elaborate



Dude, I'm going to be a jerk now. Customer is bored to death, said before is single point of login, Single sign-on has been done AH and said wrong, he wants not this thing, said to get Windows login user name, in our system add a button, a little, according to the user name to log on to our system, Ya want to function is to do not want to enter the user name password. I'm a big guy.

Haha, this demand is really enough egg pain.

PHP is not available according to your needs. You can get through JS, but you have to reduce the security settings of IE.

There is also a solution that uses Python and other languages to do jumps.

This requirement can not be done, browser security does not allow you to do so, you require customers to browse the security is not realistic, if you modify the user's computer Configuration JS, will certainly be antivirus software as a virus shielding

Can you get some high-end?

Another way of thinking, such as PHP can read to the browser's user_agent, you put this person's user_agent into a more unique, and then Judge User_agent on the line.
Although this is unsafe, it is not reliable, but can deceive people on the line.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.