Hi,
You have a series of options;
// grab the usertyype
$result = mysql_query("select * from users where username='$username' and password = '$password' limit 1");
if(mysql_num_rows($result)==1)
{
// user is logged in, do whatever else you want
$row = mysql_fetch_array($result);
$type = $row['user_type'];
// Subsequent scripts go here
}
Now.. You coul dhave an array with locations:
$locations = array(
'director'=>'page1.php',
'sa'=>'page2.php',
'programmer'=>'page3.php');
// include the right page or redirect:
include($locations[$type]);
header("location:$locations[$type]");
Or you could use a switch statement (Check the specific location of brackets and colons):
switch $type
case 'sa':
header(..);
break;
end
You could use nested if/then/elseif statements, however that gets ugly quite quickly if your set of users grows