First read my book, then my article, "Managing Users with PHP & MySQL" (on Webmasterbase.com), and you'll have everything you need!