Home >Backend Development >PHP Tutorial >PHP+DBM student recruitment program (2)_PHP tutorial
3. Delete member del.php3
require("common.php3");
$id=chop($id);
if(!isset($id))error ("Please enter the user ID to be deleted!");
elseif($pwd<>$adminpass)error("Wrong administrator password!");
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 file common.php3
$adminpass="test";
function error($msg){
?>
} ?> 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("There is no such user name!") ; 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, please use the forgotten password function!"); } dbmclose($dbm); } }else{ ?>
} ?> Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn Previous article:Xinglin classmates (1)_PHP tutorialNext article:Xinglin classmates (1)_PHP tutorial Related articlesSee more |