In some cases is necessery to have the username of the user currently loged using .htaccess and .htpasswd security. In PHP you can do that by accessing one the system / server arrays $_HTTP_SERVER_VARS , $_SERVER

<?php

echo '1.'.$HTTP_SERVER_VARS['REMOTE_USER'] ;
echo '2.'.$_SERVER['PHP_AUTH_USER'] ;
echo '3.'.$_SERVER['PHP_AUTH_PW'] ;

?>

Note that different systems might be configured differently, so you may need to dig around a little. Use the phpinfo() function in a password protected file and then view the page (which will require logging in) and search the page for your username.
Tags
Comments
Write the first comment
Leave a trace
Name *
Email *
Website
Anti SPAM * Code (8 + 4) =
Leave me a comment *
 
All comments are subject to editorial review
Post being viewed right now
Item date: 06.02.2009
Views: 1159
Item date: 12.10.2009
Views: 827
Item date: 07.10.2010
Views: 1122
Item date: 24.08.2009
Views: 723
Item date: 27.09.2009
Views: 814
Item date: 14.02.2010
Views: 1485
Item date: 22.11.2011
Views: 143
Item date: 07.03.2009
Views: 1766
Item date: 20.07.2009
Views: 438
Item date: 12.04.2009
Views: 945