In a .cgi file (PERL), located inside a password protected directory, I need to capture
$auth_user
$auth_pw
$ip
That is, a user has already logged-in using .htaccess authentication on a UNIX server. So, their auth info is already set when they reach this .cgi file.
If I was trying to accomplish this in a PHP file, the equivalent would simply be coded as:
$auth_user = $PHP_AUTH_USER;
$auth_pw = $PHP_AUTH_PW;
$ip = $REMOTE_ADDR;
But I am not using PHP in this situation.
Does anyone know offhand what the calls (and exact syntax) would to perform the same feat in a PERL instead?
Thanks in advance.
Except for the password one, your code did the trick. (I don't know why only the password code did not work, though.)
The server info is:
Apache 1.3.31 (Unix)
Perl Version 5.6.1
When a user logs in to that password-protected directory, the .htaccess calls a .htpasswd file from off the web (parallel to /public_html/). In that offweb text-file (.htpasswd) the passwords are crypted when created (by another perl file).
But since my new perl file is only seek to retrieve the info from the logged-in user's browser, I would not think it matters.
Anyway, I appreciate your help. Thanks again.