PHP + DBM logging program (2) 3. delete member del. php3 <br/> & lt ;? <Br/> require (& quot; common. php3 & quot;); 3. delete member del. php3
Require ("common. php3 ");
$ Id = chop ($ id );
If (! Isset ($ id) error ("Enter the user id to delete! ");
Elseif ($ pwd <> $ adminpass) error ("The administrator password is incorrect! ");
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 ){
?>
Upload record error
Upload record error |
Error cause: Click here to return to the previous page to check whether your input is correct.
[Back to previous page] |
Style = "font-size: 9pt"> Copyright 200x y10k. Allrights reserved. |
|
|
}
?>
5. log on to the login. php3 file.
Require ("common. php3 ");
If ($ submit ){
$ Id = chop ($ id );
If ($ id = "") error ("Enter your user name! ");
Else {
$ Dbm = dbmopen ("password", "r ");
If (! Dbmexists ($ dbm, $ id) error ("this user name is not available! ");
Else {
$ Pass = dbmfetch ($ dbm, $ id );
If ($ pass = $ password ){
Setcookie ("login", $ id, time () + 31536000 );
Header ("location: index. php3 ");
} Else error ("your password is incorrect! If you forget your password, use the forgot password function! ");
}
Dbmclose ($ dbm );
}
} Else {
?>
Shenzhen high school 2000 High School (12) class transcript: All rights reserved: Xin? @ Shenzhen high school 2000 High School (12)
Transcript of class 12 of the 2000 Shenzhen High School |
}
?>