I want to create a log in system using htaccess and htpasswd file and PHP for the server-side code, but when the user logs in I want to be able to identify that user, so how can I know what the user typed in as their username using PHP code (I assume I won't need to know the password if they've managed to access the restricted page)?
Many thanks, Ben
You just need the following to get the username that is currently in use for an authenticated session:
rev1
In light of @Ben's comment I've now found the section in the PHP documentation at HTTP authentication with PHP that explains what's going on: