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

PHP+DBM student recruitment program (4)_PHP tutorial

WBOY
Release: 2016-07-21 16:03:38
Original
964 people have browsed it

8、注册文件reg.php3
require("common.php3");
require("mail.php3");
if($submit){
if($id=="")error("请填写您的注册用户名!");
elseif(!eregi("^[0-9a-zA_Z]+$",$id))error("你的用户名不能含有其他字符!");
elseif($password=="")error("请填写您的密码!");
elseif($password<>$password1)error("您的密码填写不正确!");
  elseif($name=="")error("请填写您的名字!");
  elseif($mail=="")error("请填写您的邮件地址!");
  else{
    $dbm=dbmopen("class","w");
    if(dbmexists($dbm,$id))error("这个用户名已经给别人注册了!");
    else{
      $intro=nl2br($intro);
      $data="$name|!:!|$nickname|!:!|$mail|!:!|$home|!:!|$oicq|!:!|$icq|!:!|$add|!:!|$tel|!:!|$birth|!:!|$job|!:!|$intro|!:!|$sex";
      dbminsert($dbm,$id,$data);
      $pwd=dbmopen("password","w");
      dbminsert($pwd,$id,$password);
    }
    dbmclose($dbm);
    $sendmsg="欢迎注册《深圳中学2000届高中(12)班同学录》n";
    $sendmsg.="下面是您的注册信息:n";
    $sendmsg.="用户名:$idn用户密码;$passwordn";
    $sendmsg.="=====================================================";
    $sendmsg.="注册姓名:$namen注册昵称:$nicknamen注册邮箱:$mailn主页地址:$homen";
    $sendmsg.="您的OICQ:$oicqn您的 ICQ:$icqn联系地址:$addn联系电话:$teln";
    $sendmsg.="您的生日:$birthn您的职业:$jobn您的性别;$sexn您的个人介绍:n$intronn";
    $sendmsg.="======================================================";
    $sendmsg.="欢迎注册《深圳中学2000届高中(12)班同学录》";
    $sendmsg.="登陆地址:http://5212.net/class/";
    mail2("欢迎注册《深圳中学2000届高中(12)班同学录》",$sendmsg,$mail);
    header("Location:index.php3");
  }
}else{
?>
同学录用户注册







  



    
  
      

        
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
            
            
            
          
486>
                                                        
                                             align=middle bgcolor=#ffffff height=25 width=121>Your occupation:
                                               < "job"> lt;option value="Other">Other
                                     gt;
                                           align=middle bgcolor=#ffffff height=25 width=121>Your gender: "sex">
>                                                                                             ;/tr>
                                                 
                                                                                                                                                     >                                                                                                                                                                 
                  
                
              
            
          
            
        
注册同学录
注册用户名:   
              
              *必须填写
您的密码:   
              
              *必须填写
重复密码:   
              
              *必须填写
NickName:   
              
            
电子邮件:   
              
              *必须填写
您的OICQ:   
              
            
您的主页:   
              
            
您的 ICQ:   
              
            
您的名字:   
              
              *必须填写
您的电话:   
              
            
出生日期:   
              
              *类似2000-10-10

      




}
?>

9、建立数据库的文件run.php3

$dbm=dbmopen("class","c");
dbmclose($dbm);
$dbm=dbmopen("password","c");
dbmclose($dbm);
?> 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316228.htmlTechArticle8、注册文件reg.php3 ? require(common.php3); require(mail.php3); if($submit){ if($id==)error(请填写您的注册用户名!); elseif(!eregi(^[0-9a-zA_Z]+$,$id))error(你的用户...
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