PHP+DBM的同学录程序(2)


Posted in PHP onOctober 09, 2006

3、删除成员del.php3
<?
require("common.php3");
$id=chop($id);
if(!isset($id))error("请输入要删除的用户ID !");
elseif($pwd<>$adminpass)error("管理员密码错误!");
else{
  $data=dbmopen("class","w");
  dbmdelete($data,$id);
  dbmclose($data);
  $data=dbmopen("password","w");
  dbmdelete($data,$id);
  dbmclose($data);
  header("location:index.php3");
}
?>

4、公用文件common.php3
<?
$adminpass="test";
function error($msg){
?>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css"><title>同学录 出错</title></head><body bgcolor="#ffffff">
<html><head></head><body bgcolor="#FFFFFF"><center><table border="0" width="80%" height="80%" cellspacing="0" cellpadding="0">
<tr><td width="100%"><table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr><td width="100%"><table border="0" cellspacing="1" width="100%" align=left height="320">
<tr><td width="100%" bgcolor="#FFB500" align=center height="31"><font color="#804000"><span style="font-size: 11pt">同学录 出错</span></font></td>
</tr><tr><td width="100%" align=left height="247" bgcolor="#F7F7F7"><span style="font-size: 11pt"><p align="center">
出错原因:<font color="#FF0000"><? echo $msg;?></font></p><p align="center"><a href="javascript:history.go(-1);"><font color="#000000">请点这里返回上一页检查你的输入是否有误</font></a></p>
<p align="center">[ <a href="javascript:history.go(-1);">返回上一页</a> ]</p></span></td></tr><tr><td width="100%" bgcolor="#FFB500" height="30"><p align="right"><span   
style="font-size: 9pt"><font color="#804000">Copyright 200x y10k </font><font face="Arial" color="#804000">.Allrights reserved.</font></span></td>
</tr></table></td></tr></table></td></tr></table></center></body></html>
<?
}
?>

5、登陆文件login.php3
<?
require("common.php3");
if($submit){
$id=chop($id);
  if($id=="")error("请输入您的用户名称!");
  else{
    $dbm=dbmopen("password","r");
    if(!dbmexists($dbm,$id))error("没有这个用户名称!");
    else{
      $pass=dbmfetch($dbm,$id);
      if($pass==$password){
        setcookie("login",$id,time()+31536000);
        header("location:index.php3");
      }else error("您的密码不对!如果忘记密码,请使用忘记密码功能!");
    }
    dbmclose($dbm);
  }
}else{
?>
<html>
<head>
<title>深圳中学2000届高中(12)班同学录:::版权所有:辛??@深圳中学2000届高中(12)班</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">  
<!--
body    {background: buttonface; border: 0;}
#titleBar    {text-align: left;
            width: 300;
            height: 20px;
            border: 0px solid navy; background: navy; color: white; font-family: verdana; font-size: 12px;
            font-weight: bold;
            padding: 3;
            padding-left: 15;
            z-index: 2;}
#box    {width: 300;
        border: 15px solid navy; border-top: 0; background: white; color: black; font-family: verdana; font-size: 12px;
        padding: 5;
        z-index: 1;}
table    {width: 240; margin: 10px; margin-top: 20px;}
td        {color: black; font-family: verdana; font-size: 12px;}
.textInput    {background: white; color: black;
            width: 160px;
            border-top: 1px solid gray;
            border-left: 1px solid gray;
            border-right: 1px solid #eeeeee;
            border-bottom: 1px solid #eeeeee;
            }
.button        {font-family: verdana; font-size: 12px; background: navy; color: white; border-width: 1px;}
.pos    {width: 100%; height: 100%; text-align: center;}
-->
</style>
</head>

<body bgcolor="#FFFFFF" scroll="no">
<table class="pos">
  <tr>
    <td>  
      <div id="titleBar">深圳中学2000届高中(12)班同学录</div>
      <div id="box">  
        <form action="login.php3">
          <table width="348">
            <tr>  
              <td colspan="2"><label for="userInp" accesskey="u"><u>U</u>sername:</label>  
                <input type="text" name="id" class="textInput" id="userInp">
              </td>
            </tr>
            <tr>  
              <td colspan="2"><label for="pwdInp" accesskey="p"><u>P</u>assword:</label>  
                <input type="password" name="password" class="textInput" id="pwdInp">
              </td>
            </tr>
            <tr>  
              <td style="text-align: right">
                <div align="left">>><a href="forgetpwd.php3">忘记密码点击这里</a><<</div>
              </td>
              <td style="text-align: right">  
                <input type="submit" value="登陆" class="button" name="submit">
                    
                <input type="button" value="注册" class="button" onClick="window.open('reg.php3')" name="button2">
              </td>
            </tr>
          </table>
        </form>
      </div>
    </td>
  </tr>
</table>
</body>
</html>
<?
}
?> 

PHP 相关文章推荐
提取HTML标签
Oct 09 PHP
杏林同学录(六)
Oct 09 PHP
亲密接触PHP之PHP语法学习笔记1
Dec 17 PHP
使用adodb lite解决问题
Dec 31 PHP
sourcesafe管理phpproj文件的补充说明(downmoon)
Apr 11 PHP
PHP 反向排序和随机排序代码
Jun 30 PHP
php的memcached客户端memcached
Jun 14 PHP
浅析php单例模式
Nov 25 PHP
PHP实现的json类实例
Jul 28 PHP
php二维码生成以及下载实现
Sep 28 PHP
详解PHP发送邮件知识点
May 06 PHP
discuz论坛更换域名,详细文件修改步骤
Dec 09 PHP
基于mysql的bbs设计(一)
Oct 09 #PHP
基于mysql的bbs设计(二)
Oct 09 #PHP
基于mysql的bbs设计(三)
Oct 09 #PHP
支持oicq头像的留言簿(一)
Oct 09 #PHP
NT IIS下用ODBC连接数据库
Oct 09 #PHP
怎样在UNIX系统下安装php3
Oct 09 #PHP
怎样在UNIX系统下安装MySQL
Oct 09 #PHP
You might like
php继承中方法重载(覆盖)的应用场合
2015/02/09 PHP
PHP函数引用返回的实例详解
2016/09/11 PHP
基于Jquery的$.cookie()实现跨越页面tabs导航实现代码
2011/03/03 Javascript
jQuery学习笔记 操作jQuery对象 CSS处理
2012/09/19 Javascript
不用锚点也可以平滑滚动到页面的指定位置实现代码
2013/05/08 Javascript
jQuery+ajax中getJSON() 用法实例
2014/12/22 Javascript
jQuery实现鼠标跟随提示层效果代码(可显示文本,Div,Table,Html等)
2016/04/18 Javascript
原生js轮播(仿慕课网)
2017/02/15 Javascript
解析Vue 2.5的Diff算法
2017/11/28 Javascript
webpack配置导致字体图标无法显示的解决方法
2018/03/06 Javascript
微信jssdk逻辑在vue中的运用详解
2018/11/14 Javascript
vue实现购物车抛物线小球动画效果的方法详解
2019/02/13 Javascript
JavaScript实现图片上传并预览并提交ajax
2019/09/30 Javascript
vue中keep-alive,include的缓存问题
2019/11/26 Javascript
webgl实现物体描边效果的方法介绍
2019/11/27 Javascript
vue实现淘宝购物车功能
2020/04/20 Javascript
python 获取et和excel的版本号
2009/04/09 Python
Win7上搭建Cocos2d-x 3.1.1开发环境
2014/07/03 Python
Python使用MySQLdb for Python操作数据库教程
2014/10/11 Python
python+requests+unittest API接口测试实例(详解)
2017/06/10 Python
Python操作Sql Server 2008数据库的方法详解
2018/05/17 Python
解决csv.writer写入文件有多余的空行问题
2018/07/06 Python
对python制作自己的数据集实例讲解
2018/12/12 Python
Python内置random模块生成随机数的方法
2019/05/31 Python
Python虚拟环境venv用法详解
2020/05/25 Python
python,Java,JavaScript实现indexOf
2020/09/09 Python
CSS3实现红包抖动效果
2020/12/23 HTML / CSS
六一儿童节活动策划方案
2014/01/27 职场文书
自主招生教师推荐信
2014/05/10 职场文书
信用卡结清证明怎么写
2014/09/13 职场文书
报到证办理个人委托书
2014/10/06 职场文书
2014年高一班主任工作总结
2014/12/05 职场文书
中考学习决心书
2015/02/04 职场文书
通过shell脚本对mysql的增删改查及my.cnf的配置
2021/07/07 MySQL
Win11 引入 Windows 365 云操作系统,适应疫情期间混合办公模式:启动时直接登录、模
2022/04/06 数码科技
zabbix 代理服务器的部署与 zabbix-snmp 监控问题
2022/07/15 Servers