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{ ?>
} ?>
Previous article:Xinglin classmates (1)_PHP tutorial
Next article:Three ways to access and query mysql data in PHP_PHP tutorial
Statement of this Website
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
Latest Articles by Author
Latest Issues
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|