in reply to apache authentication

Apache (based on CGI standards) publishes the name of the remote user in the environment the CGI is executed in. Looking at
$ENV{'REMOTE_USER'}
will give you the username as long as they are logged in.
Update: Chaged % to $ ... stupid typos