PDA

View Full Version : mysql+php login system with usergroups



evileks
April 23rd, 2006, 11:30 PM
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!

GPP
April 23rd, 2006, 11:50 PM
Read both parts: http://www.phpfreaks.com/tutorial_cat/7/Membership-Systems.php

Start with the bottom one

evileks
April 23rd, 2006, 11:53 PM
Thanks! I'll totally look these over.

Seb Hughes
April 24th, 2006, 10:48 AM
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.

mathew.er
April 24th, 2006, 11:01 AM
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.

JoshuaJonah
April 24th, 2006, 11:17 AM
'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.