我尝试为团队负责人创建登录会话,以检查自己组中有多少员工。我创建了一个会话变量,如 $_SESSION['teamcode']; 它能够访问其他寻呼机。但是,它无法显示 mnay 团队成员在屏幕上的状态。
这是我的登录代码:
session_unset();
session_start();
$LoginRS__query=sprintf("SELECT staffid, password, teamcode, accessid FROM tbl_staff WHERE staffid='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $conn) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
switch ($loginStrGroup) {
case $MM_fldUserAuthorization='2':
header("Location: admin.php");
break;
case $MM_fldUserAuthorization='3':
$row_LoginRS = mysql_fetch_array($LoginRS);
$_POST['teamcode'] = $row_LoginRS['teamcode'];
header("Location: team_member.php");
break;
访问 team_member.php 代码是:
session_start();
ob_start();
mysql_select_db($database_conn, $conn);
$query_RsStaff = "SELECT * FROM tbl_staff WHERE teamcode = '".$_GET['teamcode']."'";
$query_limit_RsStaff = sprintf("%s LIMIT %d, %d", $query_RsStaff, $startRow_RsStaff, $maxRows_RsStaff);
$RsStaff = mysql_query($query_limit_RsStaff, $conn) or die(mysql_error());
$totalRows_RsStaff = mysql_num_rows($RsStaff);
$count=0;
<body>
<td align="center" bgcolor="#dfdfdf"><?php echo $row_RsStaff['staffid']; ?></td>
</body>
感谢您的任何帮助和建议。