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>&补充:Php教程,Php常用代码