ok so I figured otu what was wrong...I changed the code to this:
CODE
<?php
if (!isset($_SESSION)) {
session_start();
}
switch ($_SESSION['MM_UserGroup']) {
case "eti":
header('Location: http://www.webtestinglab.com/eti/index.php')
break;
case "eti2":
header('Location: http://www.webtestinglab.com/eti2/index.php')
break;
case "eti3":
header('Location: http://www.webtestinglab.com/eti3/index.php')
break;
default:
header('Location: http://www.webtestinglab.com/sorry.php');
}
?>
but that session variable holds 3 values, not just the access level....here is the code that creates that session variable in the login page
CODE
$LoginRS__query=sprintf("SELECT UserName, Password, Access_Level FROM eti WHERE UserName=%s AND Password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $XXXXXX) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'Access_Level');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
how do I pull the access level only out of the database and put it into a session variable? I know what I need to do, I just have little exp w/ PHP and how it works and syntax
This post has been edited by supersssweety: 17 Jul, 2007 - 09:29 AM