Page 1 of 1
PHP file permissions
Posted: Fri Mar 27, 2009 11:30 am
by asp30
I have created web pages for different user students and lecturers but I want to limit the access the users have to the web pages, I want the users to access only some pages, can you please help me how I can permit and restrict access to the pages, I have already created my register and login.
Thanks everyone
Re: PHP file permissions
Posted: Fri Mar 27, 2009 1:19 pm
by Christopher
Do you only want each user to be in one group? Or will you need users to have multiple roles? Are you limiting users to whole pages, or will you also limit them to parts of pages?
Re: PHP file permissions
Posted: Fri Mar 27, 2009 1:31 pm
by asp30
I have two users’ students and lecturers, I want the lecturer to view three pages and the student has 2 pages to view and they shouldn't view each others pages, and its whole pages not part.
Thanks
Re: PHP file permissions
Posted: Fri Mar 27, 2009 1:48 pm
by Christopher
Simplest would be to add a field to your database table of users (maybe called something like 'access' or 'group') that could be set to the value 'student' or 'lecturer' (or 1, 2). The on each page check that column value to see if the user is allowed access.