班级管理部分:
   首页: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>

<body bgcolor="#FFFFFF" text="#000000">
<p>&nbsp;</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>&nbsp;"."忘记密码,向管理员<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;?>'>

  <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>


</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 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>

<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> 

杏林同学录(八)的更多相关文章

  1. 杏林同学录(三)

    客人主页:class/guest.php欢迎来到94级1班同学录

  2. 杏林同学录(一)

    php$sitename="杏林同学录";//站点名$url="http://medguider.host.wayall.com/";//站点url$db=mysql_connect;//这里改为您的mysql用户名密码mysql_select_db;$supervisor="demo";//超级管理员名$superpsw="demo";//超级管理员密码$superemail="demo@demo.com";//超级管理员email$question1="demo";//注册提示问题1$answer1=

  3. BBS(php &amp; mysql)完整版(八)

    //完毕wishyousucess!!

  4. 杏林同学录(四)

    session_is_registered||)//检查是否注册,如userregister未注册或session为空值,重新注册.{echo"请重新注册";exit;}?phpinclude"config.php";$result=mysql_query;$row=mysql_num_rows;//查看结果有多少行for{$name=mysql_result;$sex=mysql_result;$birth=mysql_result;$ph=mysql

  5. 杏林同学录(六)

    返回";exit;}echo"回答正确,进入第二步。>您的回答

  6. PHP+DBM的同学录程序(1)

    >深圳中学2000届高中班同学录A{text-decoration:none;color:#336699;font-family:"宋体";font-size:9pt}A:hover{text-decoration:underline;color:#FF0000;font-family:"宋体";font-size:9pt}body{font-family:"宋体","serif";font-size:9pt

  7. 杏林同学录(五)

    密码查询:class/querypsw.php询问密码

  8. PHP+DBM的同学录程序(5)

    dbmexists)error("没有这个用户ID!>的资料A{COLOR:#336699;FONT-FAMILY:"宋体";FONT-SIZE:9pt;TEXT-DECORATION:none}A:hover{COLOR:#ff0000;FONT-FAMILY:"宋体";FONT-SIZE:9pt;TEXT-DECORATI

  9. 杏林同学录(九)

    session_is_registered)//检查是否注册{echo"请重新进行管理员登陆";exit;}include;if{//判断是否要删除mysql_query;//以留言时间为删除标志echo"删除成功!php$result=mysql_query;$row=mysql_num_rows;//查看结果有多少行$max=$row;//帖子总数//设每页显示10篇,$p总页数,$page第几页,$low从第几行开始读,$x读取几行

  10. 用PHP和ACCESS写聊天室(八)

    emotion.php3:代码如下:表情动作

随机推荐

  1. PHP个人网站架设连环讲(一)

    先下一个OmnihttpdProffesinalV2.06,装上就有PHP4beta3可以用了。PHP4给我们带来一个简单的方法,就是使用SESSION(会话)级变量。但是如果不是PHP4又该怎么办?我们可以假设某人在15分钟以内对你的网页的请求都不属于一个新的人次,这样你可以做个计数的过程存在INC里,在每一个页面引用,访客第一次进入时将访问时间送到cookie里。以后每个页面被访问时都检查cookie上次访问时间值。

  2. PHP函数学习之PHP函数点评

    PHP函数使用说明,应用举例,精简点评,希望对您学习php有所帮助

  3. ecshop2.7.3 在php5.4下的各种错误问题处理

    将方法内的函数,分拆为2个部分。这个和gd库没有一点关系,是ecshop程序的问题。会出现这种问题,不外乎就是当前会员的session或者程序对cookie的处理存在漏洞。进过本地测试,includes\modules\integrates\ecshop.php这个整合自身会员的类中没有重写integrate.php中的check_cookie()方法导致,验证cookie时返回的username为空,丢失了登录状态,在ecshop.php中重写了此方法就可以了。把他加到ecshop.php的最后面去就可

  4. NT IIS下用ODBC连接数据库

    $connection=intodbc_connect建立数据库连接,$query_string="查询记录的条件"如:$query_string="select*fromtable"用$cur=intodbc_exec检索数据库,将记录集放入$cur变量中。再用while{$var1=odbc_result;$var2=odbc_result;...}读取odbc_exec()返回的数据集$cur。最后是odbc_close关闭数据库的连接。odbc_result()函数是取当前记录的指定字段值。

  5. PHP使用JpGraph绘制折线图操作示例【附源码下载】

    这篇文章主要介绍了PHP使用JpGraph绘制折线图操作,结合实例形式分析了php使用JpGraph的相关操作技巧与注意事项,并附带源码供读者下载参考,需要的朋友可以参考下

  6. zen_cart实现支付前生成订单的方法

    这篇文章主要介绍了zen_cart实现支付前生成订单的方法,结合实例形式详细分析了zen_cart支付前生成订单的具体步骤与相关实现技巧,需要的朋友可以参考下

  7. Thinkphp5框架实现获取数据库数据到视图的方法

    这篇文章主要介绍了Thinkphp5框架实现获取数据库数据到视图的方法,涉及thinkPHP5数据库配置、读取、模型操作及视图调用相关操作技巧,需要的朋友可以参考下

  8. PHP+jquery+CSS制作头像登录窗(仿QQ登陆)

    本篇文章介绍了PHP结合jQ和CSS制作头像登录窗(仿QQ登陆),实现了类似QQ的登陆界面,很有参考价值,有需要的朋友可以了解一下。

  9. 基于win2003虚拟机中apache服务器的访问

    下面小编就为大家带来一篇基于win2003虚拟机中apache服务器的访问。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  10. Yii2中组件的注册与创建方法

    这篇文章主要介绍了Yii2之组件的注册与创建的实现方法,非常不错,具有参考借鉴价值,需要的朋友可以参考下

返回
顶部