Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.