Send Windows 2k/xp UserID to MySql table using PHP/CGI

Apache with PHP/MYSQL on Novell 6.5 Server.

I am creating a page that will require an identification for tracking and auditing purposes.
In Php page (hidden tex box), I want to retrieve get value %USERNAME%. I have not succeeded with
Javascript or any other method yet. This username is the LOGGED In user of a windows workstation.
You can type set at the command prompt to see the information I need.

Possible using PHP or CGI ? I am not trained well enough in either of these.

Who is Participating?
ahoffmannConnect With a Mentor Commented:
you do not mean %USERNAME% from the client, do you?
impossible (or you need to install malware on the client)
msammisAuthor Commented:
Answer: The user name from the Windows Login.

I ended up using this script in an .hta page and it works well. The normal box that warns you does not appear
because of using the .hta.

<script language="JavaScript">
function username() {
var Network = new ActiveXObject("WScript.Network")
var username = (Network.UserName)
var computername = (Network.ComputerName)
document.{HTMLFormName}.{Branch_PCName_Name}.value=(computername); }
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.