<?
require("common.php3");
$id=chop($id);
if(!isset($id))error("請輸入要刪除的用戶ID !");
elseif($pwd<>$adminpass)error("管理員密碼錯誤!");
else{
$data=dbmopen("class","w"); " /> 久久国产人妖系列,日韩精品欧美专区,国内精品视频久久

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

PHP+DBM的同學錄程序(2)

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)班同學錄:::版權所有:辛 主站蜘蛛池模板: 攀枝花市| 招远市| 陆良县| 天全县| 西平县| 横山县| 沂源县| 塘沽区| 元江| 蒲江县| 泰安市| 江孜县| 中江县| 平乡县| 莲花县| 清镇市| 工布江达县| 宁陵县| 通榆县| 新密市| 旬邑县| 香格里拉县| 磐安县| 澄江县| 济宁市| 台州市| 三江| 合江县| 宁河县| 香港 | 梁河县| 凯里市| 临沭县| 旌德县| 文水县| 石渠县| 翁牛特旗| 云龙县| 大方县| 稻城县| 日喀则市|