⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 detail.php

📁 希望这个对大家有用
💻 PHP
字号:
<?php require_once('Connections/member.php'); ?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** 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 == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "message.php?error=5";
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;
}
?>
<?php
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;
}
}

$colname_rsMember = "-1";
if (isset($_GET['username'])) {
  $colname_rsMember = (get_magic_quotes_gpc()) ? $_GET['username'] : addslashes($_GET['username']);
}
mysql_select_db($database_member, $member);
$query_rsMember = sprintf("SELECT * FROM members WHERE username = %s", GetSQLValueString($colname_rsMember, "text"));
$rsMember = mysql_query($query_rsMember, $member) or die(mysql_error());
$row_rsMember = mysql_fetch_assoc($rsMember);
$totalRows_rsMember = mysql_num_rows($rsMember);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>会员<?php echo $row_rsMember['username']; ?>的个人信息</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table border="1" align="center" cellpadding="5" bordercolor="#316AC5">
  <caption>
    会员<?php echo $row_rsMember['username']; ?>的个人资料
  </caption>
  <tr>
    <td rowspan="3" align="center" nowrap="nowrap"><img src="<?php echo $row_rsMember['photo']; ?>" width="68" height="68" /></td>
    <th nowrap="nowrap">姓名</th>
    <td nowrap="nowrap"><?php echo $row_rsMember['username']; ?></td>
    <th nowrap="nowrap">出生日期</th>
    <td nowrap="nowrap"><?php echo $row_rsMember['birthdate']; ?></td>
  </tr>
  <tr>
    <th nowrap="nowrap">性别</th>
    <td nowrap="nowrap"><?php echo $row_rsMember['gender']; ?></td>
    <th nowrap="nowrap">电子信箱</th>
    <td nowrap="nowrap"><?php echo $row_rsMember['email']; ?></td>
  </tr>
  <tr>
    <th nowrap="nowrap">角色</th>
    <td nowrap="nowrap"><?php echo ( $row_rsMember['role'] ==0 ? "普通会员" : "管理员" ) ; ?></td>
    <th nowrap="nowrap">注册时间</th>
    <td nowrap="nowrap"><?php echo $row_rsMember['regtime']; ?></td>
  </tr>
  <tr>
    <th nowrap="nowrap">自我介绍</th>
    <td colspan="4"><?php echo $row_rsMember['introduce']; ?></td>
  </tr>
</table>
<p align="center">
  <input name="Submit" type="button" onclick="javascript:window.close();" value="关闭窗口" />
</p>
</body>
</html>
<?php
mysql_free_result($rsMember);
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -