Mysql+php login system with usergroups

Does anyone know of a tutorial for creating a php login system connected to a mysql database with usergroups? I have most of my CMS for my website done, however I need to find a login system to restrict access to certain pages depending on their user group. For example a “staff” member would have access to a news submit page whereas a “registered” member would only have access to viewing pages or download pages.

Any help is appreciated!

Read both parts: http://www.phpfreaks.com/tutorial_cat/7/Membership-Systems.php

Start with the bottom one

Thanks! I’ll totally look these over.

To restict people, use sessions, so when there logined in check there sessions with the allowed for that page, so if they dont redirect them and if there allowed let themm access the page.

Go with what Seb says. Make an authorization table where you can store session ids and user ids. Then according to session id take that users info from database and siply check if this users usergroup applies for displaying specific content. Have this authorization script included on every site to guarantee some reasonable safety and you will do just ok.

‘PHP5 for Flash’ by David Powers (FOD) has a really good writeup on secure flash logins. It’s a full tutorial for multiple login access levels.