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

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


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