Actually, write now I'm writing a PHP class for user authentication. What I'm doing is using PEAR:😃B for database queries (right now I use SQLite, but if I want to do MySQL it's just a couple of lines changed as opposed to all the queries).
I will be doing it as authentication against the DB through forms, using sessions to maintain the user across pages. I would definitely recommend writing a class to handle user authentication, or getting one someone else wrote (I'll be putting mine online once I'm done). It will make your actually coding 100% simpler and easier to understand. And if you are doing databases, use PEAR:😃B for greater transportability.