[EMAIL PROTECTED] wrote: > > Below is the code I try in my apache server at windows XP, but it > return null for both remote_user() or user_name(). > > #!C:\Perl\bin\perl > use CGI; > my $query = new CGI; > my $userName= $query->user_name(); > my $remoteUser = $query->remote_user(); > print "Content-type: text/html\n\n"; > print "<h2>User Name</h2> $userName\n"; > print "<h2>Remote User</h2> $remoteUser\n";
I thought you were using an IIS server? IIS is very different from Apache, and only IIS supports Integrated Windows Authentication, which I think is what you are using as you expected to see the Windows user name in your CGI script. Authentication must be set up at the server and, once it is enabled, the remote user name will be available in the environment variables as I descibed. You cannot test your script on an Apache server or from the command line as the environment is different. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/