3. Delete Member Del.php3
Require ("common.php3");
$id =chop ($id);
if (!isset ($id)) error ("Please enter the user ID to delete! ");
ElseIf ($pwd <> $adminpass) error ("Administrator password is wrong! ");
else{
$data =dbmopen ("Class", "W");
Dbmdelete ($data, $id);
Dbmclose ($data);
$data =dbmopen ("Password", "w");
Dbmdelete ($data, $id);
Dbmclose ($data);
Header ("location:index.php3");
}
?>
4. public file Common.php3
$adminpass = "Test";
Function error ($MSG) {
?>
<title>Yearbook Error</title>
Yearbook Error |
Cause of Error:
Please click here to go back to the previous page to check if your input is wrong
[Back to previous page] |
Style= "font-size:9pt" >copyright 200x y10k. Allrights reserved.
|
|
|
}
?>
5. login File Login.php3
Require ("common.php3");
if ($submit) {
$id =chop ($id);
if ($id = = "") Error ("Please enter your user name!") ");
else{
$DBM =dbmopen ("password", "R");
if (!dbmexists ($DBM, $id)) error ("No this user name!") ");
else{
$pass =dbmfetch ($dbm, $id);
if ($pass = = $password) {
Setcookie ("Login", $id, Time () +31536000);
Header ("location:index.php3");
}else error ("Your password is wrong!") If you forget your password, please use the forgot password feature! ");
}
Dbmclose ($DBM);
}
}else{
?>
<title>Shenzhen Middle School 2000 session High School (12) class Yearbook::: Copyright: Sing @ Shenzhen Middle School 2000 High School (12) class</title>
Shenzhen Middle School 2000 session High School (12) class Yearbook
|
}
?>
The above describes the yearbook how to write PHP+DBM Yearbook program 2, including yearbook how to write aspects of the content, I hope that the PHP tutorial interested in a friend helpful.