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
Group MySQL results by ID for looping over
I have a table with flight data in mysql. I'm writing a php code that will group and displ...
From 2024-04-06 17:27:56
0
1
406
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|