您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
杏林同学录(八)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:36:02
班级管理部分:
   首页: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>
      

[1] [2] [3] [4] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
  • 上一篇文章:
  • 下一篇文章:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |