httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Boyle <...@bourse.ch>
Subject Re: user/passowrd check using .htaccess
Date Wed, 16 Jan 2002 08:53:16 GMT
Michel COTE wrote:
> 
> Hello,
> 
> I'm using .htaccess to prevent some users from accessing some private
> directories of my web server. It works fine ........ but. I need to get back
> the login name of the user in my HTML pages (using java script or something
> else) to implement a cookie management and be able to store the user's
> preferences.

In CGI, the user name is available as the environment variable
REMOTE_USER. If you use a perl program with the CGI module, you can
reference this easily in the %ENV hash e.g.

print "Login name = $ENV{REMOTE_USER}";

Probably you can do something similar in ASP or PHP. I don't know how to
do this in JavaScript...

Rgds,

Owen Boyle.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message