Link to home
Start Free TrialLog in
Avatar of msammis
msammis

asked on

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

Server:
Apache with PHP/MYSQL on Novell 6.5 Server.

Question:
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.


ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of msammis
msammis

ASKER

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>
<script language="JavaScript">
function username() {
var Network = new ActiveXObject("WScript.Network")
var username = (Network.UserName)
var computername = (Network.ComputerName)
document.{HTMLFormName}.{BranchEmp_Name}.value=(username);
document.{HTMLFormName}.{Branch_PCName_Name}.value=(computername); }
</script>