Jump to content

add new user level


adzie

Recommended Posts

Hi people, I'd like to a further user level to the login script but i'm hitting a brick wall and was hoping someone might have some more insight.. I'd like another user level called trainee.. but would like the admins and supervisors to be able to see the same profiles as the trainee, for example below, the admins can see the supervisors pages

 

thanks for your help

 


$username = $_POST['username'];
$password = $_POST['password'];
$sql = "select * from members where name='$username' and pass='$password'";	
$rs = mysql_query($sql,$conn);
$num = mysql_numrows($rs);
$row = mysql_fetch_array($rs);
if($num != 0)
{	
	if($row['admin'] == 1)
	{
		session_start();
		if($row['supervisor'] == 1)
		{
			$_SESSION['supervisor'] = 1;
		}
		$_SESSION['online'] = 1;
		$_SESSION['admin'] = 1;			
		$_SESSION['office'] = $row[4];
		$_SESSION['id'] = $row[0];
		header("Location: index.php");
		exit;
	}
	else if($row['supervisor] == 1)
	{
		session_start();
		$_SESSION['online'] = 1;
		$_SESSION['supervisor'] = 1;
		$_SESSION['office'] = $row[4];
		$_SESSION['id'] = $row[0];
		header("Location: index.php");
		exit;
	}
					else
	{
		session_start();
		$_SESSION['online'] = 1;
		$_SESSION['id'] = $row[0];
		header("Location: index.php");
		exit;
	}

Link to comment
https://forums.phpfreaks.com/topic/85410-add-new-user-level/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.