Home > Backend Development > PHP Tutorial > PHP+DBM student recruitment program (2)_PHP tutorial

PHP+DBM student recruitment program (2)_PHP tutorial

WBOY
Release: 2016-07-21 16:03:31
Original
922 people have browsed it

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){
?>
< meta http-equiv="Content-Type" content="text/html; charset=gb2312">
Error in classmate registration
< center>





Error in classmate registration


Error reason: < ;/p>

Please click here to return to the previous page Check if your input is correct


[ Return to the 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("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{
?>


深圳中学2000届高中(12)班同学录:::版权所有:辛湜@深圳中学2000届高中(12)班






  
    
  
  
      
深圳中学2000届高中(12)班同学录

      
  
        

          
              
              
            
              
              
            
              
              
              
            
          
  
                
              
  
                
              

                
              
  
                
                    
                
              

        

      

    



}
?> 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316245.htmlTechArticle3、删除成员del.php3 ? require(common.php3); $id=chop($id); if(!isset($id))error(请输入要删除的用户ID !); elseif($pwd$adminpass)error(管理员密码错误!); else{...
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template