Solved

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

Posted on 2006-06-10
2
211 Views
Last Modified: 2013-12-25
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.


0
Comment
Question by:msammis
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 16878224
> %USERNAME%
you do not mean %USERNAME% from the client, do you?
impossible (or you need to install malware on the client)
0
 

Author Comment

by:msammis
ID: 17115474
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>
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to dynamically set the form action using jQuery.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question