希望这个对大家有用

源代码在线查看: manage.php

软件大小: 113 K
上传用户: piaoxue061906
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

				
								if (!isset($_SESSION)) {
				  session_start();
				}
				$MM_authorizedUsers = "1";
				$MM_donotCheckaccess = "false";
				
				// *** Restrict Access To Page: Grant or deny access to this page
				function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
				  // For security, start by assuming the visitor is NOT authorized. 
				  $isValid = False; 
				
				  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
				  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
				  if (!empty($UserName)) { 
				    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
				    // Parse the strings into arrays. 
				    $arrUsers = Explode(",", $strUsers); 
				    $arrGroups = Explode(",", $strGroups); 
				    if (in_array($UserName, $arrUsers)) { 
				      $isValid = true; 
				    } 
				    // Or, you may restrict access to only certain users based on their username. 
				    if (in_array($UserGroup, $arrGroups)) { 
				      $isValid = true; 
				    } 
				    if (($strUsers == "") && false) { 
				      $isValid = true; 
				    } 
				  } 
				  return $isValid; 
				}
				
				$MM_restrictGoTo = "message.php?error=6";
				if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
				  $MM_qsChar = "?";
				  $MM_referrer = $_SERVER['PHP_SELF'];
				  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
				  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) 
				  $MM_referrer .= "?" . $QUERY_STRING;
				  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
				  header("Location: ". $MM_restrictGoTo); 
				  exit;
				}
				?>
								if (!function_exists("GetSQLValueString")) {
				function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
				{
				  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
				
				  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
				
				  switch ($theType) {
				    case "text":
				      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
				      break;    
				    case "long":
				    case "int":
				      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
				      break;
				    case "double":
				      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
				      break;
				    case "date":
				      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
				      break;
				    case "defined":
				      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
				      break;
				  }
				  return $theValue;
				}
				}
				
				$currentPage = $_SERVER["PHP_SELF"];
				
				if ((isset($_GET['username'])) && ($_GET['username'] != "")) {
				  $deleteSQL = sprintf("DELETE FROM members WHERE username=%s",
				                       GetSQLValueString($_GET['username'], "text"));
				
				  mysql_select_db($database_member, $member);
				  $Result1 = mysql_query($deleteSQL, $member) or die(mysql_error());
				}
				
				$maxRows_rsMember = 5;
				$pageNum_rsMember = 0;
				if (isset($_GET['pageNum_rsMember'])) {
				  $pageNum_rsMember = $_GET['pageNum_rsMember'];
				}
				$startRow_rsMember = $pageNum_rsMember * $maxRows_rsMember;
				
				mysql_select_db($database_member, $member);
				$query_rsMember = "SELECT username, gender, `role`, regtime FROM members ORDER BY regtime DESC";
				$query_limit_rsMember = sprintf("%s LIMIT %d, %d", $query_rsMember, $startRow_rsMember, $maxRows_rsMember);
				$rsMember = mysql_query($query_limit_rsMember, $member) or die(mysql_error());
				$row_rsMember = mysql_fetch_assoc($rsMember);
				
				if (isset($_GET['totalRows_rsMember'])) {
				  $totalRows_rsMember = $_GET['totalRows_rsMember'];
				} else {
				  $all_rsMember = mysql_query($query_rsMember);
				  $totalRows_rsMember = mysql_num_rows($all_rsMember);
				}
				$totalPages_rsMember = ceil($totalRows_rsMember/$maxRows_rsMember)-1;
				
				$queryString_rsMember = "";
				if (!empty($_SERVER['QUERY_STRING'])) {
				  $params = explode("&", $_SERVER['QUERY_STRING']);
				  $newParams = array();
				  foreach ($params as $param) {
				    if (stristr($param, "pageNum_rsMember") == false && 
				        stristr($param, "totalRows_rsMember") == false) {
				      array_push($newParams, $param);
				    }
				  }
				  if (count($newParams) != 0) {
				    $queryString_rsMember = "&" . htmlentities(implode("&", $newParams));
				  }
				}
				$queryString_rsMember = sprintf("&totalRows_rsMember=%d%s", $totalRows_rsMember, $queryString_rsMember);
				?>
				
				
				
				
				会员管理
				
				
				function deleteMember ( username ) {
				  ans = confirm ( "您确实要删除这个会员吗?" );
				  if ( ans )
				    document.location = "manage.php?username=" + username;
				}
				
				
				
				
				
				
				
				  
				     
				总共  位会员
				    
				        				        
				    
				        				        
				    
				        				        
				    
				        				        
				  
				
				
				  
				    用户名
				    性别
				    角色
				    注册时间
				    操作
				  
				  
				    
				      
				      
				      
				      
				      				    
				    
				
				
				
				
								mysql_free_result($rsMember);
				?>			

相关资源