How to authenticate users with htaccess?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Can I use PHP and htaccess to authenticate users?

My service provider lets me password protect directories on my web site -
using htaccess.  If a user tries to access a page within a password
protected directory, a dialog is received requesting username and password.
But I want to provide a login page that users go to first, and then are
directed to the page/directory that they are allowed to see based on their

Is it possible to use an html form on a login page that posts the username
and password to htaccess and then automatically takes the user the specified
directory/page?  I'd like to set this up with a simple file-based systems
for a handful of users and then move to a database authentication system
using MySql when there are more users.

Is this possible?  Are there any examples out there?

Thanks in advance.

Site Timeline