You can not do what you want with HTTP Authentication, which is the actual name for what you call the "htaccess/password process". That method has to do with the web server and the web client only, and has nothing to do with HTML/XML, so there is no opportunity for you to "customize" it unless you make your own web client (browser).
What most sites do instead is a process that involces CGI. The first web page has a form and when the form is submitted, a CGI script or program on the web server reads the username and password, checks a database, and either provides a cookie with a session identifier or token. From then on, the pages are generated by CGI scripts or programs that confirm the session or the token is still valid before spitting out the "protected" content.
There are advantages and disadvantages to both methods, and you may want to consult a book or tutorial on the subject especially if your trying to protect valuable content. Try googling for HTTP authentication or CGI authentication.
Perl / MySQL / HTML+CSS