i have problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gpong
Forum Newbie
Posts: 16
Joined: Sun Aug 06, 2006 8:49 am

i have problem

Post by gpong »

is anybody know how to make rights using php. For example: if I am an admin so I can delete user id and I can do everything in the web page. and if I am a user I just can post or reply topic to web site. if everyone know website that provide this information then post it. thank you very much :)
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Quite often you have 3 levels of user...

0 - Guest
1 - User
2 - Admin

By default everyone is user level 0, when they log in they are assigned a user level from the database (either 1 or 2). This is normally stored in a session. When someone tries to do an admin function the code checks the user level and rejects it if the user is level <2.

Hope that helps.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Try
Google Query wrote:PHP (permissions OR "access control")
Post Reply