Solved

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

Posted on 2006-06-10
2
216 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help editing script 3 78
Make a file test.vbs using vbscript 5 79
[SQL server / powershell] bulk delete table from CSV 8 37
Batch File search for Drive Letter 8 43
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

792 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