Jump to content

PHP - Displaying Local User within a .php page


z20let

Recommended Posts

Hey,

 

All me and my IT Officer are looking to do at the moment is display the "current user" (windows user name)

 

We are using Apache 2.2 and unfortunately for us, most of the help and advice online is for IIS

 

Any help would be greatly appreciated thanks

 

 

Link to comment
Share on other sites

I think it entirely depends on what server your running and what info that server has access to.

 

I was trying to do this before and found it was impossible to grab that info from the client.

 

By echo'ing out phpinfo() you can see what info is available for you to grab.

Link to comment
Share on other sites

I think it entirely depends on what server your running and what info that server has access to.

 

I was trying to do this before and found it was impossible to grab that info from the client.

 

By echo'ing out phpinfo() you can see what info is available for you to grab.

 

We are just testing it locally at the moment, we have downloaded a module for apache (2.2) "mod_auth_sspi" however now that we have it the IT Officer has noticed that there are lots of other files which have been downloaded with it that may not have anything to do with the actual module file itself!?!?

 

God damn Apache!!!!  >:(

Link to comment
Share on other sites

Print current user (windows):

 

<?php
echo getenv("USERNAME");
?>

 

 

We are just going to try this now... I will let you know the result!

 

No luck unfortunately, it doesn't seem to do anything???

 

Remember we are running Apache 2.2 with MySQL 5 and PHP 5

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.