That's rather difficult especially if your site is on a shared host. But if you have the user data in a mysql table then you can do http authentication with PHP (running as apache module, alternatively use e.g. the mod_auth_mysql apache module).
Read more about that here.
Thomas