There are lots of ways to do this. I'l discuss concept, not code, for now.
Here is one method which is very secure, requires Apache, and 100% server side authenticated so no issues with Javascript or hacking or XSS (Cross Site Scripting) issues:
1) Make the link go to a unique folder with a script in the language of your choice named, say, "/special_access/process-login.php" for example
2) Set your Apache to password protect the "/special_access" folder, create as many names as you want via .htaccess with associated passwords:
How to do that, including password encryption and great tutorial
3) Once the user authenticates, the process-login.php script runs, it will pass the login username as a variable to a switch or if/then/else type of function that redirects to specific pages based on the username.
BTW, in PHP you can detect the login username that the user typed in by doing something like this:[FONT=Verdana, Arial, Helvetica][/FONT]
PHP:
$auth_username = $_SERVER["REMOTE_USER"];
If that server variable does not exist, password protect a page that runs phpinfo() and search for the username and use that variable instead.
If you do not run Apache, see if your web server can password protect in a similar manner and if you can access the username info via server side code.
If there is NO way to do this via your web server, then you will need to install or write a login function in the language your server supprts which protects the page and allows access to the username in memory. But make sure any third party script doesn't use cookies or Javascript in any way to handle login - you only want to deal with sessions and server side processing to maximize security.
An integrated login environment in PHP is pretty easy to do these days, using session control with minimal cookie use,
such as this one.
Hope these concepts gave you ideas. I'm sure others might have some cool suggestions also, just keep security in mind as you make your final decision.
-jim