User Permissions
Moderator: General Moderators
User Permissions
How do i go about setting permissions for those who login and for those users that are registered?
Sorry, i realize that i didn't explain myself clearly enough?
What i want to happen is that when a user logs in they are redirected to another form based on their permissions. For example some users will be able to add/edit/update/delete/view records from the database whereas others will only have add/view permissions.
Hope this is more clear!
What i want to happen is that when a user logs in they are redirected to another form based on their permissions. For example some users will be able to add/edit/update/delete/view records from the database whereas others will only have add/view permissions.
Hope this is more clear!
$query = "SELECT permissions FROM users WHERE user=$username";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
switch($row) {
case 'A':
header('admin.php');
case 'B':
header('employee.php');
case 'C':
header('user.php');
}
<edit>those should all be 'header("Location:' whatever.php
i.e. header('Location:user.php');</edit>
$result = mysql_query($query);
$row = mysql_fetch_row($result);
switch($row) {
case 'A':
header('admin.php');
case 'B':
header('employee.php');
case 'C':
header('user.php');
}
<edit>those should all be 'header("Location:' whatever.php
i.e. header('Location:user.php');</edit>
Last edited by llimllib on Wed Jul 31, 2002 2:20 pm, edited 2 times in total.
Question a: you decide
Question b: you decide
Question c: you decide
Really, it's all up to you. Whenever, however, and whomever you choose can change those permissions. Hell, you could give a random permission at each logon. You could institute a moderation system. You could do anything you wanted to with that field in the database.
Question b: you decide
Question c: you decide
Really, it's all up to you. Whenever, however, and whomever you choose can change those permissions. Hell, you could give a random permission at each logon. You could institute a moderation system. You could do anything you wanted to with that field in the database.
Well, actually setting up random permissions would probably not be very intelligent for the welfare of your site. It was meant as a joke.
Secondly, try some code, dude. The only way to learn this stuff is to try and write some for hours on end. Read tutorials. Read about the mt_rand() function. read about mysql and about sql in general. DO SOME WORK! it'll be fun, I promise.
Secondly, try some code, dude. The only way to learn this stuff is to try and write some for hours on end. Read tutorials. Read about the mt_rand() function. read about mysql and about sql in general. DO SOME WORK! it'll be fun, I promise.