admin and user
Moderator: General Moderators
admin and user
Plz , how to solve if when user login, system can realize he is an admin or an user???
- MrPotatoes
- Forum Regular
- Posts: 617
- Joined: Wed May 24, 2006 6:42 am
there are a lot of ways, depending on how many different levels of permissions you want, but if you just want admin or user permissions, you could set a column in your database or whatever you use to store username and password...
Code: Select all
<?php
if($posted['username'] == $datasource['username'] && $posted['password'] == $datasource['password'])
{
$_SESSION['logged_in'] = true;
$_SESSION['admin'] = false;
if($datasource['admin'])
{
$_SESSION['admin'] = true;
}
}
?>