www.9778.com杏林同学录(五)

班级管理部分:
   首页:superadmin.php
<?php
include (“class/config.php”);
if ($superadmin){      //如果已经进行管理员登陆,进行密码验证
  if (!($supername==$supervisor)||!($superpass==$superpsw)){  
   echo “密码错误”;
   exit;
   }else{ //用session记录管理员登陆
   session_start(); // 开始session
   session_register(“superlogin”);
   $superlogin=$supername;   
   }
}else{              //管理员登陆
echo “<form name=’form1′ method=’post’ action=’$PHP_SELF’>”;
echo “<div align=’center’> 请输入管理员密码<br>”;
echo “管理员”;  
echo “<input type=’text’ name=’supername’><br>”;
echo “密码”;
echo “<input type=’password’ name=’superpass’><br>”;
echo “<input type=’submit’ name=’superadmin’
value=’进入’><br>”;
echo “<input type=’reset’ name=’cancel’
value=’重写’></div>”;   
echo “</form>”;
exit;
}
?>
<html>
<head>
<title>班级管理</title>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
</head>

个人管理:
   班级通讯录:class/address.php
<?
session_start(); // 开始session
if(!session_is_registered(“userregister”)||($userregister==””))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo “<a href=’../index.php’>请重新注册<BR>”;
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>班级通讯录</TITLE>
<style type=”text/css”>
<!–
.white12 {  font-size: 12pt; color: #FFFFFF; text-decoration: none}
.blue9 {  font-size: 9pt; color: #9999FF}
–>
</style>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<table width=”98%” border=”0″ cellspacing=”0″ cellpadding=”0″
height=”65″>
  <tr>  
    <td width=”35%”><img src=”image/classlogo.gif” width=”224″
height=”60″> </td>
    <td width=”65%”>  
      <table width=”97%” border=”1″ cellspacing=”0″ cellpadding=”0″
bordercolorlight=”#CC0000″ bordercolordark=”#FFFFFF”
bordercolor=”#FFFFFF”>
        <tr>  
          <td><img src=”image/aslist.gif” width=”470″
height=”70″ alt=”班级通讯录”></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<?php
include “config.php”;
$result = mysql_query(“SELECT * FROM user”,$db);
$row=mysql_num_rows($result);//查看结果有多少行
for ($i=0;$i<=($row-1);$i++) {
   $name=mysql_result($result,$i,’name’);
   $sex=mysql_result($result,$i,’sex’);
   $birth=mysql_result($result,$i,’birth’);
   $ph=mysql_result($result,$i,’ph’);
   $bp=mysql_result($result,$i,’bp’);
   $email=mysql_result($result,$i,’email’);
   $oicq=mysql_result($result,$i,’oicq’);
   $work=mysql_result($result,$i,’work’);
   $photo=mysql_result($result,$i,’photo’);
   $ad=mysql_result($result,$i,’ad’);
   $post=mysql_result($result,$i,’post’);
   $account=mysql_result($result,$i,’account’);
   $face=mysql_result($result,$i,’face’);
   $face=’image/face/icon’.$face;
   echo “<table width=’76%’ border=’1′ cellspacing=’0′
cellpadding=’0′ bordercolorlight=’#330099′ bordercolordark=’#FFFFFF’
align=’center’ class=’blue9′> <tr bgcolor=’#3399FF’> <td
colspan=’8′>      <div class=’white12′
align=’center’>………………….○班级通讯录○………………..</div>    </td>
</tr> <tr>  <td width=’30%’><img src=’$face.gif’
width=’32’ height=’32’> 姓名:$name</td>  <td
colspan=’6′>性别:$sex</td> <td
width=’35%’>生日:$birth</td>  </tr> <tr> <td
colspan=’7′>电话: $ph</td> <td
width=’34%’>传呼:$bp</td> </tr> <tr>  <td
colspan=’7′>Email:<a
href=’mailto:$email’>$email</a></td>  <td
width=’34%’>oicq:$oicq</td> </tr> <tr> <td
colspan=’7′>工作单位:$work</td> <td
width=’34%’>邮编:$post</td></tr> <tr><td
colspan=’8′>通讯地址:$ad</td></tr> <tr>  <td
colspan=’8′>个人照片:$photo</td> </tr>  <tr> <td
colspan=’8′>个人说明:$account</td>
</tr></table>”;
}   
?>  

注册部分:
   注册步骤1: class/register_step1.php
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>班级通讯录-注册第一步</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<?php
include “config.php”;
if ($Submit){
$answers1=trim($answers1);
$answers2=trim($answers2);
if (!($answers1==$answer1)||!($answers2==$answer2)){
echo “回答错误!<a
href=’javascript:history.back()’>返回</a>”;
exit;
}
echo “回答正确,<a
href=’register_step2.php?answer=right’>进入第二步</a>。”;
exit;
}
?>
<table width=”73%” border=”0″ cellspacing=”0″ cellpadding=”0″
align=”center” height=”190″>
  <tr>  
    <td height=”76″>
      <div align=”center”><img src=”image/classlogo.gif”
width=”224″ height=”60″></div>
    </td>
  </tr>
  <tr>
    <td height=”32″>  
      <div align=”center”>注册第一步-身份验证</div>
    </td>
  </tr>
  <tr>
    <td height=”153″>
      <p align=”center”>请回答以下问题</p>
      <form name=”form1″ method=”post” action=”<? echo
$PHP_SELF;?>”>
        <div align=”center”>1.<? echo
$question1?><br>
          您的回答  
          <input type=”text” name=”answers1″>
          <br>
          2.<? echo $question2?><br>
          您的回答  
          <input type=”text” name=”answers2″>
          <br>
          <input type=”submit” name=”Submit” value=”确认”>
          <input type=”reset” name=”cancel” value=”重写”>
        </div>
      </form>
      <p align=”center”><br>
        <br>
        实在想不起来了,<a
href=”querypsw.php”>问问管理员吧</a>。<br>
      </p>
    </td>
  </tr>
</table>
</BODY>
</HTML>
注册步骤2: class/register_step2.php
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>94级1班通讯录-注册第二步</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<?php
if (!$answer==”right”){          //页面保护
echo “请不要投机取巧!”;
exit;
}
include “config.php”;
if ($submit){
if
(!$username||!$psw||!$psw2||!$name||!$ad||!$ph||!$email){           //检查是否填写完整
      echo “对不起,您2必须填所有带*的项目!<BR>”.”<a
href=’javascript:history.back()’>返回</a>”;
      exit;
    }
$username=trim($username);
$psw=trim($psw);
$psw2=trim($psw2);
$name=trim($name);
$birth=$year.’-‘.$month.’-‘.$day;
$work=trim($work);
$ad=trim($ad);
$post=trim($post);
$ph=trim($ph);
$bp=trim($bp);
$email=trim($email);
$oicq=trim($oicq);
$account=strip_tags(trim($account));//去掉首尾空格及html标记
$signature=strip_tags(trim($signature));
//检验此名字是否已被注册
$result = mysql_query(“SELECT name FROM user where
name=’$name'”,$db);
if (mysql_num_rows($result)!=0){   
echo “此名字已有人注册!”.”<a
href=’javascript:history.back()’>重新填写</a> “.”忘记密码,向管理员<a
href=’querypsw.php’>索要密码</a>”;
exit;
}
//检验用户名是否被使用
$result = mysql_query(“SELECT user FROM user where
user=’$username'”,$db);//若返回列的数目不为0,说明此用户名已有人使用
if (mysql_num_rows($result)!=0){   
echo “此用户名已有人使用!”.”<a
href=’javascript:history.back()’>重新填写</a>”;
exit;
}
//检查密码重复是否正确
if (!$psw==$psw2){
echo “请确认密码,<a
href=’javascript:history.back()’>返回</a>”;
exit;
}
//检查email的合法性
if(!ereg(‘^[-!#$%&’*+./0-9=?A-Z^_`a-z{|}~]+’.’@’.'[-!#$%&’*+/0-9=?A-Z^_`a-z{|}~]+.’.'[-!#$%&’*+./0-9=?A-Z^_`a-z{|}~]+$’,$email)&&$email){
       echo “email不合法!<BR>”.”<a
href=’javascript:history.back()’>重填</a><BR>”;
       exit;}
//写入数据库
  $sql=”INSERT INTO user
(user,psw,name,sex,birth,work,ad,post,ph,bp,email,oicq,account,signature,face)
VALUES
(‘$username’,’$psw’,’$name’,’$sex’,’$birth’,’$work’,’$ad’,’$post’,’$ph’,’$bp’,’$email’,’$oicq’,’$account’,’$signature’,’$face’)”;
$result = mysql_query($sql,$db);
mysql_close($db);
//发祝贺邮件
$subject=”祝贺你成功注册”.$sitename.”!”;//主题
$message=$name.”,你好:<BR>  祝贺你成功注册同学录!您的用户名为”.$username.”,密码为”.$psw.”<BR>现在登陆<a
href=’$url’>$sitename</a>”;//信件内容
$headers .= “Content-Type: text/html; charset=gb2312n”; // Mime type
mail($email,$subject,$message,$headers);//离线状态下调试时,这一句可能会出错,不必管它,传到服务器上即可。
echo “恭喜您注册成功!一封欢迎信已发到您的邮箱,请注意查收。”,”<a
href=’../index.php’>现在登录</a>”;  
exit;
}  
?>
<table width=’95%’ border=’0′ cellspacing=’0′ cellpadding=’0′
align=’center’>
  <tr>  
    <td colspan=”2″>  
      <div align=”center”><img src=”image/classlogo.gif”
width=”224″ height=”60″></div>
    </td>
  </tr>
  <tr>  
    <td>  
      <div align=”center”>注册第二步-填写个人资料<br>
        注意不要有空格,带*的项目为必填。</div>
    </td>
  </tr>
  <tr>  
    <td colspan=”2″>  
      <form method=’post’ action='<? echo
$PHP_SELF;?>?answer=right’>
        <table width=”95%” border=”1″ cellspacing=”1″ cellpadding=”0″
align=”center” bordercolor=”#FFCC00″>
          <tr>
            <td height=”153″ width=”60%”><br>
              用户名:  
              <input type=’Text’ name=’username’ size=’12’
maxlength=’12’>
              *<br>
              (英文字母或加数字,长度不超过12)<br>
          密码:  
          <input type=’password’ name=’psw’ size=’8′
maxlength=’8′>
              *<br>
              (英文字母或加数字,长度不超过8个字符)<br>
          确认密码:  
          <input type=’password’ name=’psw2′ size=’8′
maxlength=’8′>
          *<br>
          姓名:  
          <input type=’Text’ name=’name’ size=’8′ maxlength=’8′>
          *<br>
          性别:男  
          <input type=’radio’ name=’sex’ value=’男’ checked>
          女  
          <input type=’radio’ name=’sex’ value=’女’>
          <br>
          生日:  
          <select name=’year’>
            <option selected>1991</option>
            <option>1990</option>
            <option>1989</option>
            <option>1988</option>
            <option>1987</option>
            <option>1986</option>
            <option>1985</option>
            <option>1984</option>
            <option>1983</option>
            <option>1982</option>
            <option>1981</option>
            <option>1980</option>
            <option>1979</option>
            <option>1978</option>
            <option>1977</option>
            <option>1976</option>
            <option>1975</option>
            <option>1974</option>
            <option>1973</option>
            <option>1972</option>
            <option>1971</option>
            <option>1970</option>
            <option>1969</option>
            <option>1968</option>
            <option>1967</option>
            <option>1966</option>
            <option>1965</option>
            <option>1964</option>
            <option>1963</option>
            <option>1962</option>
            <option>1961</option>
            <option>1960</option>
            <option>1959</option>
            <option>1958</option>
            <option>1957</option>
            <option>1956</option>
            <option>1955</option>
            <option>1954</option>
          </select>
          年  
          <select name=’month’>
            <option selected>01</option>
            <option>02</option>
            <option>03</option>
            <option>04</option>
            <option>05</option>
            <option>06</option>
            <option>07</option>
            <option>08</option>
            <option>09</option>
            <option>10</option>
            <option>11</option>
            <option>12</option>
          </select>
          月  
          <select name=’day’>
            <option selected>01</option>
            <option>02</option>
            <option>03</option>
            <option>04</option>
            <option>05</option>
            <option>06</option>
            <option>07</option>
            <option>08</option>
            <option>09</option>
            <option>10</option>
            <option>11</option>
            <option>12</option>
            <option>13</option>
            <option>14</option>
            <option>15</option>
            <option>16</option>
            <option>17</option>
            <option>18</option>
            <option>19</option>
            <option>20</option>
            <option>21</option>
            <option>22</option>
            <option>23</option>
            <option>24</option>
            <option>25</option>
            <option>26</option>
            <option>27</option>
            <option>28</option>
            <option>29</option>
            <option>30</option>
            <option>31</option>
          </select>
          日<br>
          工作单位:  
          <input type=’Text’ name=’work’ size=’30’
maxlength=’50’>
          <br>
          通讯地址:  
          <input type=’Text’ name=’ad’ size=’30’ maxlength=’50’>
          *<br>
          邮编:  
          <input type=’Text’ name=’post’ size=’6′ maxlength=’6′>
          <br>
          电话:  
          <input type=’Text’ name=’ph’ size=’15’ maxlength=’30’>
          *<br>
          传呼:  
          <input type=’Text’ name=’bp’ size=’15’ maxlength=’20’>
          <br>
          Email:  
          <input type=’Text’ name=’email’ size=’15’
maxlength=’35’>
          *<br>
          oicq:  
          <input type=’Text’ name=’oicq’ size=’12’
maxlength=’12’>
          <br>
          个人说明:(在通讯录里显示,不超过125个汉字)<BR>
          <textarea name=’account’ cols=’50’
rows=’5′></textarea>
          <br>
          个人签名:(在留言簿的自动签名,不超过125个汉字)<br>
              <textarea name=”signature” cols=”50″
rows=”5″></textarea>
            </td>
            <td height=”153″ width=”40%”><br>
              选择一个自己喜欢的头像:<br>
          <img src=”image/face/icon1.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”1″ checked>
          <img src=”image/face/icon2.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”2″>
          <img src=”image/face/icon3.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”3″>
          <img src=”image/face/icon4.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”4″>
          <img src=”image/face/icon5.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”5″>
          <img src=”image/face/icon6.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”6″>
          <img src=”image/face/icon7.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”7″>
          <img src=”image/face/icon8.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”8″>
          <img src=”image/face/icon9.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”9″>
          <img src=”image/face/icon10.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”10″>
              <img src=”image/face/icon11.gif” width=”32″
height=”32″>  
              <input type=”radio” name=”face” value=”11″>
          <img src=”image/face/icon12.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”12″>
          <img src=”image/face/icon13.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”13″>
          <img src=”image/face/icon14.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”14″>
          <img src=”image/face/icon15.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”15″>
          <img src=”image/face/icon16.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”16″>
          <img src=”image/face/icon17.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”17″>
          <img src=”image/face/icon18.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”18″>
          <img src=”image/face/icon19.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”19″>
          <img src=”image/face/icon20.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”20″>
          <br>
          <img src=”image/face/icon21.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”21″>
          <img src=”image/face/icon22.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”22″>
          <img src=”image/face/icon23.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”23″>
          <img src=”image/face/icon24.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”24″>
          <img src=”image/face/icon25.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”25″>
          <img src=”image/face/icon26.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”26″>
          <img src=”image/face/icon27.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”27″>
          <img src=”image/face/icon28.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”28″>
          <img src=”image/face/icon29.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”29″>
          <img src=”image/face/icon30.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”30″>
          <img src=”image/face/icon31.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”31″>
          <img src=”image/face/icon32.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”32″>
          <img src=”image/face/icon33.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”33″>
          <img src=”image/face/icon34.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”34″>
          <img src=”image/face/icon35.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”35″>
          <img src=”image/face/icon36.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”36″>
          <img src=”image/face/icon37.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”37″>
          <img src=”image/face/icon38.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”38″>
          <img src=”image/face/icon39.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”39″>
          <img src=”image/face/icon40.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”40″>
          <br>
          <img src=”image/face/icon41.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”41″>
          <img src=”image/face/icon42.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”42″>
          <img src=”image/face/icon43.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”43″>
          <img src=”image/face/icon44.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”44″>
          <img src=”image/face/icon45.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”45″>
          <img src=”image/face/icon46.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”46″>
          <img src=”image/face/icon47.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”47″>
          <img src=”image/face/icon48.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”48″>
          <img src=”image/face/icon49.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”49″>
          <img src=”image/face/icon50.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”50″>
              <img src=”image/face/icon51.gif” width=”32″
height=”32″>  
              <input type=”radio” name=”face” value=”51″>
          <img src=”image/face/icon52.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”52″>
          <img src=”image/face/icon53.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”53″>
          <img src=”image/face/icon54.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”54″>
          <img src=”image/face/icon55.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”55″>
          <img src=”image/face/icon56.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”56″>
          <img src=”image/face/icon57.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”57″>
          <img src=”image/face/icon58.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”58″>
          <img src=”image/face/icon59.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”59″>
          <img src=”image/face/icon60.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”60″>
          <br>
          <img src=”image/face/icon61.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”61″>
          <img src=”image/face/icon62.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”62″>
          <img src=”image/face/icon63.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”63″>
          <img src=”image/face/icon64.gif” width=”32″
height=”32″>  
          <input type=”radio” name=”face” value=”64″>
          <br>
            </td>
          </tr>
        </table>
        <div align=”center”>
          <br>
          <input type=’Submit’ name=’submit’ value=’提交’>
          <input type=’reset’ name=’Reset’ value=’重写 ‘>
        </div>
      </form>
    </td>
  </tr>
</table>
</BODY>
</HTML> 

密码查询:class/querypsw.php
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>询问密码</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<?php
  include “config.php”;
//询问班级注册问题密码
  if ($class){
   $headers .= “Content-Type: text/html; charset=gb2312n”; // Mime
type
   $subject=”询问班级注册问题密码 “;                        //主题
   $message=nl2br($message);
   $message=”查询人:”.$name.”<BR>留言:<BR>”.$message;     //内容
   mail($superemail,$subject,$message,$headers);
   echo “恭喜您,您的请求已经向管理员发出,近期内请注意查收email。”;
   exit;
  }
  //询问个人注册密码
  if ($member){  
  $result = mysql_query(“SELECT * FROM user where
user=’$username'”,$db);
  if
(mysql_num_rows($result)==0){  //若返回列的数目为0,说明无此资料
echo “我们的数据库中无此用户,请确认。注意大小写。<a
href=’javascript:history.back()’>返回</a>”;
exit;}
   $myemail=mysql_result($result,0,”email”);//读取user数据库中的email
    if (!$myemail){                         //如果还没有email,则返回
     echo “我们的数据库中没有您的email,请再次填写。<a
href=’javascript:history.back()’>返回</a>”;
     exit;
    }
$psw=mysql_result($result,0,”psw”);      //密码
$name=mysql_result($result,0,”name”);    //姓名
$subject=”询问个人注册密码”;
$message=$name.”,您好。您的用户名是”.$username.”,密码是”.$psw.”。<BR>———————–<BR><a
href='”.$url.”‘>”.$sitename.”</a>”;      //信件内容
$headers .= “Content-Type: text/html; charset=gb2312n”; // Mime type
mail($myemail,$subject,$message,$headers);
   echo
“恭喜您,系统已经向您的信箱中发出了答复信件,请注意查收email。”;
   exit;
  }
?>  
<table width=”93%” border=”0″ cellspacing=”0″ cellpadding=”0″
align=”center” height=”286″>
  <tr>  
        <td height=”75″ colspan=”2″>  
          <div align=”center”>询问密码<br>
          </div>
        </td>
      </tr>
      <tr>  
        <td height=”75″ width=”47%”>
          <form name=”form1″ method=”post” action=”<? echo
$PHP_SELF;?>”><div
align=”center”>询问班级注册问题答案<br>
            您的姓名  
            <input type=”text” name=”name”>
            <br>您的留言(写上能证实您身份的简短留言及email地址)
<textarea name=”message” rows=”3″ cols=”50″></textarea>
            <br>
            系统将向班级管理员发送您的请求,是否确认?<br>

<body bgcolor=”#FFFFFF” text=”#000000″>
<p> </p>
<table width=”73%” border=”0″ cellspacing=”0″ cellpadding=”0″
align=”center” height=”208″>
  <tr>  
    <td>
      <div align=”center”><img src=”class/image/classlogo.gif”
width=”224″ height=”60″></div>
    </td>
  </tr>
  <tr>  
    <td>  
      <div align=”center”>班级管理</div>
    </td>
  </tr>
  <tr>  
    <td>  
      <div align=”center”>
        <a href=”class/admin/addmember.php”
target=”_blank”>添加成员</a><br>
        <a href=”class/admin/member.php”
target=”_blank”>显示、删除成员</a><br>
        <a href=”class/admin/editmember.php”
target=”_blank”>修改成员信息</a><br>
        <a href=”class/notebook/delnote.php”
target=”_blank”>班级留言管理</a><br>
        <a href=”class/notebookg/delnote.php”
target=”_blank”>客人留言管理</a></div>
    </td>
  </tr>
</table>
</body>
</html>
添加成员:class/admin/addmember.php
<?
session_start();
if(!session_is_registered(“superlogin”))//检查是否注册
{
echo “<a
href=’../../superadmin.php’>请重新进行管理员登陆<BR>”;
exit;
}
include “../config.php”;
if ($submit){
if (!$username||!$name){           //检查是否填写完整
      echo “对不起,您必须填所有带*的项目!<BR>”.”<a
href=’javascript:history.back()’>返回</a>”;
      exit;
    }
$username=trim($username);
$psw=trim($psw);
$name=trim($name);
$birth=$year.’-‘.$month.’-‘.$day;
$work=trim($work);
$ad=trim($ad);
$post=trim($post);
$ph=trim($ph);
$bp=trim($bp);
$email=trim($email);
$oicq=trim($oicq);
//检验此名字是否已被注册
$result = mysql_query(“SELECT name FROM user where
name=’$name'”,$db);
if (mysql_num_rows($result)!=0){   
echo “此名字已有人注册!”.”<a
href=’javascript:history.back()’>重新填写</a> “.”忘记密码,向管理员<a
href=’querypsw.php’>索要密码</a>”;
exit;
}
//检验用户名是否被使用
$result = mysql_query(“SELECT user FROM user where
user=’$username'”,$db);//若返回列的数目不为0,说明此用户名已有人使用
if (mysql_num_rows($result)!=0){   
echo “此用户名已有人使用!”.”<a
href=’javascript:history.back()’>重新填写</a>”;
exit;
}
//写入数据库
  $sql=”INSERT INTO user
(user,psw,name,sex,birth,work,ad,post,ph,bp,email,oicq) VALUES
(‘$username’,’$psw’,’$name’,’$sex’,’$birth’,’$work’,’$ad’,’$post’,’$ph’,’$bp’,’$email’,’$oicq’)”;
$result = mysql_query($sql,$db);
mysql_close($db);
echo “添加成功”;  
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE> 添加成员 </TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<form method=’post’ action='<? echo $PHP_SELF;?>’>

</BODY>
</HTML>
个人资料修改:class/modify.php
<?
session_start(); // 开始session
if(!session_is_registered(“userregister”)||($userregister==””))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo “<a href=’../index.php’>请重新注册<BR>”;
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>个人资料修改</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<?php
include “config.php”;
if ($submit){
if
(!$username||!$psw||!$psw2||!$name||!$ad||!$ph||!$email){           //检查是否填写完整
      echo “对不起,您必须填所有带*的项目!<BR>”.”<a
href=’javascript:history.back()’>重填</a>”;
      exit;
    }
$user=trim($username);
$psw=trim($psw);
$psw2=trim($psw2);
$name=trim($name);
$birth=trim($birth);
$work=trim($work);
$ad=trim($ad);
$post=trim($post);
$ph=trim($ph);
$bp=trim($bp);
$email=trim($email);
$oicq=trim($oicq);
$account=strip_tags(trim($account));//去掉首尾空格及html标记
$signature=strip_tags(trim($signature));
//检查密码重复是否正确
if (!$psw==$psw2){
echo “请确认密码,<a
href=’javascript:history.back()’>返回</a>”;
exit;
}
//检查email的合法性
if(!ereg(‘^[-!#$%&’*+./0-9=?A-Z^_`a-z{|}~]+’.’@’.'[-!#$%&’*+/0-9=?A-Z^_`a-z{|}~]+.’.'[-!#$%&’*+./0-9=?A-Z^_`a-z{|}~]+$’,$email)&&$email){
       echo “email不合法!<BR>”.”<a
href=’register_step2.php?yname=$name’>重填</a><BR>”;
       exit;}
//写入数据库
$sql=”UPDATE user SET
user=’$user’,psw=’$psw’,name=’$name’,sex=’$sex’,birth=’$birth’,work=’$work’,ad=’$ad’,post=’$post’,ph=’$ph’,bp=’$bp’,email=’$email’,oicq=’$oicq’,account=’$account’,signature=’$signature’,face=’$face’
where user=’$userregister'”;
$result = mysql_query($sql,$db);
mysql_close($db);
//发祝贺邮件
$subject=”祝贺你成功修改个人信息”.$sitename.”!”;//主题
$message=$name.”,你好:<BR>  祝贺你成功修改个人信息!您的用户名为”.$username.”,密码为”.$psw.”<BR>现在登陆<a
href=’$url’>$sitename</a>”;//信件内容
$headers .= “Content-Type: text/html; charset=gb2312n”; // Mime type
mail($email,$subject,$message,$headers);
echo “恭喜您修改成功!一封欢迎信已发到您的邮箱,请注意查收。”;
exit;
}
$result = mysql_query(“SELECT * FROM user where
user=’$userregister'”,$db);
$psw=mysql_result($result,0,”psw”);
$name=mysql_result($result,0,”name”);//读取个人注册信息
$sex=mysql_result($result,0,”sex”);
$birth=mysql_result($result,0,”birth”);
$work=mysql_result($result,0,”work”);
$ad=mysql_result($result,0,”ad”);
$post=mysql_result($result,0,”post”);
$ph=mysql_result($result,0,”ph”);
$bp=mysql_result($result,0,”bp”);
$email=mysql_result($result,0,”email”);
$oicq=mysql_result($result,0,”oicq”);
$photo=mysql_result($result,0,”photo”);
$account=mysql_result($result,0,”account”);
$signature=mysql_result($result,0,”signature”);
$face=mysql_result($result,0,”face”);
mysql_close($db);
?>
<table width=’95%’ border=’0′ cellspacing=’0′ cellpadding=’0′
align=’center’>
  <tr>  
    <td colspan=”2″>  
      <div align=”center”><img src=”image/classlogo.gif”
width=”224″ height=”60″></div>
    </td>
  </tr>
  <tr>  
    <td>  
      <div align=”center”>个人资料修改<br>
        注意不要有空格,带*的项目为必填。</div>
    </td>
  </tr>
  <tr>  
    <td colspan=”2″>  
      <form method=’post’ action='<? echo $PHP_SELF;?>’>
        <table width=”95%” border=”1″ cellspacing=”1″ cellpadding=”0″
align=”center” bordercolor=”#FFCC00″>
          <tr>
            <td height=”153″ width=”60%”><br>
              用户名:  
              <input type=’Text’ name=’username’ size=’12’
maxlength=’12’ value=”<? echo $userregister;?>”>
              *<br>
              (英文字母或加数字,长度不超过12)<br>
          密码:  
          <input type=’password’ name=’psw’ size=’8′ maxlength=’8′
value=”<? echo $psw; ?>”>
              *<br>
              (英文字母或加数字,长度不超过8个字符)<br>
          确认密码:  
          <input type=’password’ name=’psw2′ size=’8′ maxlength=’8′
value=”<? echo $psw; ?>”>
          *<br>
          姓名:  
          <input type=’Text’ name=’name’ size=’8′ maxlength=’8′
value=”<? echo $name; ?>”>
          *<br>
          性别:男  
          <input type=’radio’ name=’sex’ value=’男’ <? if
($sex==’男’){echo “checked”;} ?>>
          女  
          <input type=’radio’ name=’sex’ value=’女’ <? if
($sex==’女’){echo “checked”;} ?>>
          <br>
          生日:<input type=”text” name=”birth” size=”12″
maxlength=”12″ value=”<? echo $birth; ?>”><br>
          工作单位:  
          <input type=’Text’ name=’work’ size=’30’ maxlength=’50’
value=”<? echo $work; ?>”>
          <br>
          通讯地址:  
          <input type=’Text’ name=’ad’ size=’30’ maxlength=’50’
value=”<? echo $ad; ?>”>
          *<br>
          邮编:  
          <input type=’Text’ name=’post’ size=’6′ maxlength=’6′
value=”<? echo $post; ?>”>
          <br>
          电话:  
          <input type=’Text’ name=’ph’ size=’15’ maxlength=’30’
value=”<? echo $ph; ?>”>
          *<br>
          传呼:  
          <input type=’Text’ name=’bp’ size=’15’ maxlength=’20’
value=”<? echo $bp; ?>”>
          <br>
          Email:  
          <input type=’Text’ name=’email’ size=’15’ maxlength=’35’
value=”<? echo $email; ?>”>
          *<br>
          oicq:  
          <input type=’Text’ name=’oicq’ size=’12’ maxlength=’12’
value=”<? echo $oicq; ?>”>
          <br>
          个人说明:(在通讯录里显示,不超过125个汉字)<BR>
          <textarea name=’account’ cols=’50’ rows=’5′><? echo
$account; ?></textarea>
          <br>
          个人签名:(在留言簿的自动签名,不超过125个汉字)<br>
              <textarea name=”signature” cols=”50″ rows=”5″><?
echo $signature; ?></textarea>
            </td>
            <td height=”153″ width=”40%”><br>
              选择一个自己喜欢的头像:<br>
          <?
           for ($i=1;$i<=64;$i++){
            echo “<img src=’image/face/icon”.$i.”.gif’ width=’32’
height=’32’>”;  
            echo “<input type=’radio’ name=’face’ value=’$i’ “;
            if ($face==$i){
            echo “checked”;
            }
            echo “>”;
            if (($i%4)==0){ //隔4行,换行
             echo “<br>”;
            }
           }
           ?><br>
            </td>
          </tr>
        </table>
        <div align=”center”>
          <br>
          <input type=’Submit’ name=’submit’ value=’提交’>
          <input type=’reset’ name=’Reset’ value=’重写 ‘>
        </div>
      </form>
    </td>
  </tr>
</table>
</BODY>
</HTML>
上传照片:class/uploadphoto.php
<?
session_start(); // 开始session
if(!session_is_registered(“userregister”)||($userregister==””))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo “<a href=’../../index.php’>请重新注册<BR>”;
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>上传照片</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<?php
include “../config.php”;
if ($upload){
if ($picurl==”none”){
echo “你没有上传任何文件.”;
exit;
}
$v=opendir(“image”);  
  if ($v==0)  
  { mkdir(“image”); //若目录不存在,则新建一个
  $v=opendir(“image”); //取得目录handle
  }  
$up=copy(“$picurl”,”image/$picurl_name”);  
if($up==1)  
  {
  //初始化写入内容
  $result = mysql_query(“SELECT * FROM user where
user=’$userregister'”,$db);//查询以往照片信息
  $photo=mysql_result($result,0,’photo’);
  $photo=str_replace(“‘”,”‘”,$photo);//将’用’代替
  $photo=$photo.”<a
href=’upload/image/$picurl_name’>看照片</a>|”;//加上此次内容
  mysql_query(“UPDATE user SET photo=’$photo’ where
user=’$userregister'”,$db);//写入
  mysql_close($db);
  echo “文件上传成功!<BR>”;
  echo “文件名:$picurl_name 文件大小:$picurl_size byte
文件类型:$picurl_type<BR>”;
   }  
  else  
  {echo “文件上传失败.”;exit;}  
unlink ($picurl); //从临时文件夹中删除档案$picurl
closedir ($v); //关闭目录handle
exit;
}
?>
<table width=”95%” border=”0″ cellspacing=”0″ cellpadding=”0″>
  <tr>  
    <td height=”56″ width=”32%”><img
src=”../image/classlogo.gif” width=”224″ height=”60″></td>
    <td height=”56″ width=”68%”>  
      <div align=”center”>上传照片</div>
    </td>
  </tr>
  <tr>  
    <td height=”108″ colspan=”2″><form action=”<? echo
$PHP_SELF;?>” method=”post” enctype=”multipart/form-data”
name=”UL”>
        <!–注意:这里必须加上‘enctype=”multipart/form-data”
‘,否则不会产生上
传动作–>
        <div align=”center”>上传照片:
          <input type=”file” name=”picurl” size=”15″
accept=”image/x-png,image/gif,image/jpeg”>
          <br>
          <input type=”Submit” name=”upload” value=”上传”>
          <input type=”reset” name=”Reset” value=”重写”>
        </div>
      </form>  
</td>
  </tr>
</table>
</BODY>
</HTML>

          <input type=”submit” name=”class” value=”确认”>
            <input type=”reset” name=”cancel” value=”重填”>
            <br>
          </div></form>
        </td>
        <td height=”75″ width=”53%”>
          <div align=”center”>
        <form name=”form2″ method=”post” action=”<? echo
$PHP_SELF;?>”>
          询问个人注册密码<br>
          <br>
          您的用户名(不是姓名)<br>
          <br>

  <table width=”51%” border=”1″ cellspacing=”1″ cellpadding=”0″
align=”center” bordercolor=”#FFCC00″>
    <tr>
            <td height=”153″ width=”60%”><br>
              用户名:  
              <input type=’Text’ name=’username’ size=’12’
maxlength=’12’>
              *<br>
              (英文字母或加数字,长度不超过12)<br>
          密码:  
          <input type=’password’ name=’psw’ size=’8′
maxlength=’8′>
              <br>
              (英文字母或加数字,长度不超过8个字符)<br>
          姓名:  
          <input type=’Text’ name=’name’ size=’8′ maxlength=’8′>
          *<br>
          性别:男  
          <input type=’radio’ name=’sex’ value=’男’ checked>
          女  
          <input type=’radio’ name=’sex’ value=’女’>
          <br>
          生日:  
          <select name=’year’>
            <option selected>1991</option>
            <option>1990</option>
            <option>1989</option>
            <option>1988</option>
            <option>1987</option>
            <option>1986</option>
            <option>1985</option>
            <option>1984</option>
            <option>1983</option>
            <option>1982</option>
            <option>1981</option>
            <option>1980</option>
            <option>1979</option>
            <option>1978</option>
            <option>1977</option>
            <option>1976</option>
            <option>1975</option>
            <option>1974</option>
            <option>1973</option>
            <option>1972</option>
            <option>1971</option>
            <option>1970</option>
            <option>1969</option>
            <option>1968</option>
            <option>1967</option>
            <option>1966</option>
            <option>1965</option>
            <option>1964</option>
            <option>1963</option>
            <option>1962</option>
            <option>1961</option>
            <option>1960</option>
            <option>1959</option>
            <option>1958</option>
            <option>1957</option>
            <option>1956</option>
            <option>1955</option>
            <option>1954</option>
          </select>
          年  
          <select name=’month’>
            <option selected>01</option>
            <option>02</option>
            <option>03</option>
            <option>04</option>
            <option>05</option>
            <option>06</option>
            <option>07</option>
            <option>08</option>
            <option>09</option>
            <option>10</option>
            <option>11</option>
            <option>12</option>
          </select>
          月  
          <select name=’day’>
            <option selected>01</option>
            <option>02</option>
            <option>03</option>
            <option>04</option>
            <option>05</option>
            <option>06</option>
            <option>07</option>
            <option>08</option>
            <option>09</option>
            <option>10</option>
            <option>11</option>
            <option>12</option>
            <option>13</option>
            <option>14</option>
            <option>15</option>
            <option>16</option>
            <option>17</option>
            <option>18</option>
            <option>19</option>
            <option>20</option>
            <option>21</option>
            <option>22</option>
            <option>23</option>
            <option>24</option>
            <option>25</option>
            <option>26</option>
            <option>27</option>
            <option>28</option>
            <option>29</option>
            <option>30</option>
            <option>31</option>
          </select>
          日<br>
          工作单位:  
          <input type=’Text’ name=’work’ size=’30’
maxlength=’50’>
          <br>
          通讯地址:  
          <input type=’Text’ name=’ad’ size=’30’ maxlength=’50’>
          <br>
          邮编:  
          <input type=’Text’ name=’post’ size=’6′ maxlength=’6′>
          <br>
          电话:  
          <input type=’Text’ name=’ph’ size=’15’ maxlength=’30’>
          <br>
          传呼:  
          <input type=’Text’ name=’bp’ size=’15’ maxlength=’20’>
          <br>
          Email:  
          <input type=’Text’ name=’email’ size=’15’
maxlength=’35’>
          <br>
          oicq:  
          <input type=’Text’ name=’oicq’ size=’12’
maxlength=’12’>
          <br>
           </td> </tr> </table>
             <div align=”center”>
          <br>
          <input type=’Submit’ name=’submit’ value=’提交’>
          <input type=’reset’ name=’Reset’ value=’重写 ‘>
        </div>
      </form>

          <input type=”text” name=”username”>
          <br>
          <br>
          <br>
            系统将会向您注册的信箱中发发送密码,是否确认?<br>
          <input type=”submit” name=”member” value=”确认”>
          <input type=”reset” name=”cancel2″ value=”重填”>
        </form>
        </div>
        </td>
      </tr>
    </table>    

</BODY>
</HTML>
显示、删除成员:class/admin/member.php
<?
session_start();
if(!session_is_registered(“superlogin”))//检查是否注册
{
echo “<a
href=’../../superadmin.php’>请重新进行管理员登陆<BR>”;
exit;
}
include “../config.php”;
if ($del==1){
mysql_query(“delete from user where user=’$user'”,$db); //删除
echo “删除成功!”;}
?>
<html>
<head>
<title>成员列表</title>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
</head>

</BODY>
</HTML>
悄悄话:privatenote.php
<?
session_start(); // 开始session
if(!session_is_registered(“userregister”)||($userregister==””))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo “<a href=’../index.php’>请重新注册<BR>”;
exit;
}
//删除留言
include “config.php”;
if ($del==”1″){
mysql_query(“delete from privatenote where id=’$id'”,$db);
//以id为删除标志
echo “删除成功!”;
}
//添加留言
if ($Submit){
$id=time();                     //以时间戳为记录号
$time=date(“Y年m月d日 h:i:s A”);//留言时间
$result = mysql_query(“SELECT * FROM user where
user=’$userregister'”,$db);
$fromuser=mysql_result($result,0,’name’);                       //发消息人姓名
$result = mysql_query(“SELECT * FROM user where name=’$yname'”,$db);
$touser=mysql_result($result,0,’user’); ;          //接受人用户名
$message=nl2br(strip_tags($ynote));//留言内容
mysql_query(“INSERT INTO privatenote (id,fromuser,touser,time,message)
values (‘$id’,’$fromuser’,’$touser’,’$time’,’$message’)”,$db);
//写入数据库
echo “留言成功!”;
}
?>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>悄悄话</TITLE>
<style type=”text/css”>
<!–
.blue9 {  font-size: 10pt; color: #9999FF; text-decoration: none}
.black10 {  font-size: 10pt}
–>
</style>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<table width=”64%” border=”1″ cellspacing=”1″ cellpadding=”1″
align=”center” “>
  <tr>  
    <td colspan=”2″ height=”63″>  
      <div align=”center”><img src=”image/classlogo.gif”
width=”224″ height=”60″>  
      </div>
    </td>
  </tr>
  <tr>
    <td class=”blue9″ colspan=”2″>  
      <div align=”center”>
      <?
      $result = mysql_query(“SELECT * FROM user where
user=’$userregister'”,$db);
      $name=mysql_result($result,0,”name”);//姓名
      echo $name;
      ?>
      的悄悄话</div>
    </td>
  </tr>
  <tr>  
    <td class=”blue9″ colspan=”2″>  
      <?php
$result = mysql_query(“SELECT * FROM privatenote where
touser=’$userregister’ ORDER BY time DESC”,$db);
$row=mysql_num_rows($result);        //悄悄话总数
            $unlook=0;   
              if (!$row==0){
              for ($i=0;$i<$row;$i++){
               $id=mysql_result($result,$i,’id’);//留言id
               $fromuser=mysql_result($result,$i,’fromuser’);//留言人姓名
               $time=mysql_result($result,$i,’time’);        //留言时间
               $message=mysql_result($result,$i,’message’);  //留言内容
               $look_s=”已看过”;                             //注释
               $look=mysql_result($result,$i,’look’);        //是否看过
               if ($look==”0″){$unlook++;$look_s=”尚未看过”;}
//计算未看过的悄悄话数目,并改变注释
               mysql_query(“UPDATE privatenote SET look=’1′ where
id=’$id'”,$db);       //将悄悄话看过状态改为1
               echo “第”,$i+1,”条 发出人:”,$fromuser,”
留言时间:”,$time,”<BR>”;
               echo ” 留言内容:”,$message,”<BR>——“,$look_s;
               echo “<a
href=’$PHP_SELF?del=1&id=$id’>删除</a><HR>”;
              }
              }
              echo “悄悄话总数:”,$row,”.”,$unlook,”条新悄悄话.”;
         ?>
</td>
  </tr>
  <tr>  
    <td class=”black10″ colspan=”2″>  
      <form method=”post” action=”<?php echo
$PHP_SELF;?>”>
        <p align=”center”>您要给谁发悄悄话?  

<body bgcolor=”#FFFFFF” text=”#000000″>
<table width=”91%” border=”0″ cellspacing=”0″ cellpadding=”0″
height=”139″ align=”center”>
  <tr>  
    <td>  
      <div align=”center”><img src=”../image/classlogo.gif”
width=”224″ height=”60″></div>
    </td>
  </tr>
  <tr>
    <td height=”28″>
      <div align=”center”>成员列表</div>
    </td>
  </tr>
  <tr>  
    <td height=”163″>
      <table width=”95%” border=”1″ cellspacing=”1″
cellpadding=”0″>
        <tr>  
          <td>  
            <div align=”center”>用户名</div>
          </td>
          <td>
            <div align=”center”>密码</div>
          </td>
          <td>
            <div align=”center”>姓名</div>
          </td>
          <td>
            <div align=”center”>删除</div>
          </td>
        </tr>
        <?
          $result = mysql_query(“SELECT * FROM user”,$db);
          $row=mysql_num_rows($result);//查看结果有多少行
           for ($i=0;$i<=($row-1);$i++) {
   $name=mysql_result($result,$i,’name’);
   $user=mysql_result($result,$i,’user’);
   $psw=mysql_result($result,$i,’psw’);
   echo “<tr>”;
   echo “<td>$name</td>”;
   echo “<td>$psw</td>”;
   echo “<td>$name</td>”;
   echo “<td><a
href=’$PHP_SELF?del=1&user=$user’>删除</a></td>”;
   echo “</tr>”;  
        }
          ?>
        </table>
    </td>
  </tr>
</table>
</body>
</html>
修改成员资料:class/admin/editmember.php
<?
session_start();
if(!session_is_registered(“superlogin”))//检查是否注册
{
echo “<a
href=’../../superadmin.php’>请重新进行管理员登陆<BR>”;
exit;
}
?>
<html>
<head>
<title>修改成员资料</title>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
</head>

          <select name=”yname”>
            <?
            $result = mysql_query(“SELECT * FROM user”,$db);
            $row=mysql_num_rows($result);            //成员人数
            for ($i=0;$i<=($row-1);$i++){
             $name=mysql_result($result,$i,’name’);  //姓名
             echo “<option>”,$name,”</option>”;
            }
            mysql_close($db);
            ?>
          </select>
          <br>
          留言内容:<br>
          <textarea name=”ynote” cols=”60″
rows=”6″></textarea>
          <br>
          <b>  
          <input type=”submit” name=”Submit” value=”确认”>
          </b>  
          <input type=”reset” name=”cancel” value=”重写”>
        </p>
      </form>
    </td>
  </tr>
</table>
</BODY>
</HTML>

<body bgcolor=”#FFFFFF” text=”#000000″>
<form name=”form1″ method=”post” action=”editmember_step2.php”>
  <table width=”95%” border=”0″ cellspacing=”0″ cellpadding=”0″>
    <tr>  
      <td height=”117″ width=”49%”>  
        <div align=”center”>您要修改谁的资料?<br>
          <select name=”member”>
          <?php
            include “../config.php”;
            $result = mysql_query(“SELECT * FROM user”,$db);
            $row=mysql_num_rows($result);//查看结果有多少行,即成员人数
            for ($i=0;$i<=($row-1);$i++){
             $name=mysql_result($result,$i,’name’);
             echo “<option>”,$name,”</option>”;
            }
          ?>             
          </select>
          <br>
          <input type=”submit” name=”Submit” value=”确定”>
          <input type=”reset” name=”cancel” value=”重置”>
        </div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>
修改成员资料步骤2:class/admin/editmember_step2.php
<?
session_start();
if(!session_is_registered(“superlogin”))//检查是否注册
{
echo “<a
href=’../../superadmin.php’>请重新进行管理员登陆<BR>”;
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html;
charset=gb2312″>
<TITLE>修改成员资料</TITLE>
</HEAD>
<BODY BGCOLOR=”#FFFFFF”>
<?php
include “../config.php”;
if ($submit){
$user=trim($username);
$psw=trim($psw);
$name=trim($name);
$birth=trim($birth);
$work=trim($work);
$ad=trim($ad);
$post=trim($post);
$ph=trim($ph);
$bp=trim($bp);
$email=trim($email);
$oicq=trim($oicq);
$photoname=trim($photoname);
$account=strip_tags(trim($account));//去掉首尾空格及html标记
$signature=strip_tags(trim($signature));
//写入数据库
$sql=”UPDATE user SET
user=’$user’,psw=’$psw’,name=’$name’,sex=’$sex’,birth=’$birth’,work=’$work’,ad=’$ad’,post=’$post’,ph=’$ph’,bp=’$bp’,email=’$email’,oicq=’$oicq’,account=’$account’,signature=’$signature’,photo=’$photoname’,face=’$face’
where name=’$member'”;
$result = mysql_query($sql,$db);
mysql_close($db);
echo “恭喜您修改成功!”;
exit;
}
$result = mysql_query(“SELECT * FROM user where
name=’$member'”,$db);
$user=mysql_result($result,0,”user”);
$psw=mysql_result($result,0,”psw”);
$sex=mysql_result($result,0,”sex”);
$birth=mysql_result($result,0,”birth”);
$work=mysql_result($result,0,”work”);
$ad=mysql_result($result,0,”ad”);
$post=mysql_result($result,0,”post”);
$ph=mysql_result($result,0,”ph”);
$bp=mysql_result($result,0,”bp”);
$email=mysql_result($result,0,”email”);
$oicq=mysql_result($result,0,”oicq”);
$photo=mysql_result($result,0,”photo”);
$account=mysql_result($result,0,”account”);
$signature=mysql_result($result,0,”signature”);
$photo=mysql_result($result,0,”photo”);
$face=mysql_result($result,0,”face”);
mysql_close($db);
?>
<table width=’95%’ border=’0′ cellspacing=’0′ cellpadding=’0′
align=’center’>
  <tr>  
    <td colspan=”2″>  
      <div align=”center”><img src=”../image/classlogo.gif”
width=”224″ height=”60″></div>
    </td>
  </tr>
  <tr>  
    <td>  
      <div align=”center”>修改成员资料</div>
    </td>
  </tr>
  <tr>  
    <td colspan=”2″>  
      <form method=’post’ action='<? echo
$PHP_SELF,’?member=’,$member;?>’>
        <table width=”95%” border=”1″ cellspacing=”1″ cellpadding=”0″
align=”center” bordercolor=”#FFCC00″>
          <tr>
            <td height=”153″ width=”60%”><br>
              用户名:  
              <input type=’Text’ name=’username’ size=’12’
maxlength=’12’ value=”<? echo $user;?>”>
              <br>
              (英文字母或加数字,长度不超过12)<br>
          密码:  
          <input type=’password’ name=’psw’ size=’8′ maxlength=’8′
value=”<? echo $psw; ?>”>
              <br>
              (英文字母或加数字,长度不超过8个字符)<br>
          姓名:  
          <input type=’Text’ name=’name’ size=’8′ maxlength=’8′
value=”<? echo $member; ?>”>
          *<br>
          性别:男  
          <input type=’radio’ name=’sex’ value=’男’ <? if
($sex==’男’){echo “checked”;} ?>>
          女  
          <input type=’radio’ name=’sex’ value=’女’ <? if
($sex==’女’){echo “checked”;} ?>>
          <br>
          生日:<input type=”text” name=”birth” size=”12″
maxlength=”12″ value=”<? echo $birth; ?>”><br>
          工作单位:  
          <input type=’Text’ name=’work’ size=’30’ maxlength=’50’
value=”<? echo $work; ?>”>
          <br>
          通讯地址:  
          <input type=’Text’ name=’ad’ size=’30’ maxlength=’50’
value=”<? echo $ad; ?>”>
              <br>
          邮编:  
          <input type=’Text’ name=’post’ size=’6′ maxlength=’6′
value=”<? echo $post; ?>”>
          <br>
          电话:  
          <input type=’Text’ name=’ph’ size=’15’ maxlength=’30’
value=”<? echo $ph; ?>”>
              <br>
          传呼:  
          <input type=’Text’ name=’bp’ size=’15’ maxlength=’20’
value=”<? echo $bp; ?>”>
          <br>
          Email:  
          <input type=’Text’ name=’email’ size=’15’ maxlength=’35’
value=”<? echo $email; ?>”>
              <br>
          oicq:  
          <input type=’Text’ name=’oicq’ size=’12’ maxlength=’12’
value=”<? echo $oicq; ?>”>
              <br>
              个人照片:
              <input type=’text’ name=’photoname’ value=”<? echo
$photo; ?>”>
              <br>
          个人说明:(在通讯录里显示,不超过125个汉字)<BR>
          <textarea name=’account’ cols=’50’ rows=’5′><? echo
$account; ?></textarea>
          <br>
          个人签名:(在留言簿的自动签名,不超过125个汉字)<br>
              <textarea name=”signature” cols=”50″ rows=”5″><?
echo $signature; ?></textarea>
            </td>
            <td height=”153″ width=”40%”><br>
              选择一个自己喜欢的头像:<br>
          <?
           for ($i=1;$i<=64;$i++){
            echo “<img src=’../image/face/icon”.$i.”.gif’ width=’32’
height=’32’>”;  
            echo “<input type=’radio’ name=’face’ value=’$i’ “;
            if ($face==$i){
            echo “checked”;
            }
            echo “>”;
            if (($i%4)==0){ //隔4行,换行
             echo “<br>”;
            }
           }
           ?><br>
            </td>
          </tr>
        </table>
        <div align=”center”>
          <br>
          <input type=’Submit’ name=’submit’ value=’提交’>
          <input type=’reset’ name=’Reset’ value=’重写 ‘>
        </div>
      </form>
    </td>
  </tr>
</table>
</BODY>
</HTML>