PHP+DBM的同學錄程式(2)
來源:互聯網
上載者:User
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>&