Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache userID in JavaScript

Status
Not open for further replies.

martinm

IS-IT--Management
Mar 30, 2001
113
0
0
GB
I want to use the Apache userid in some JavaScript, either from within the JS or passed from the HTML (via an OnClick event).

Note Apache 1.3(!) on Debian.

Must be easy but Google can't help.


Ta,

Martin.
 
Martin,
I'm not sure what you mean by the "Apache userid", which taken literally would be the user account under which the server is running. I really don't think you want to expose that!

Assuming you meant the "userid" of the client on the browser, you *may* be able to get the value from one of the HTTP headers, which are available to you as server variables. For example, in ASP you could code:

var userid = Request.ServerVariables ("REMOTE_USER");

Note however that there are also other possibilities such as "LOGON_USER" and "AUTH_USER". Read up on the headers (try W3Schools) to determine which you need.
 
Thanks, that gives me a starting point!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top