Home > Backend Development > PHP Tutorial > Classmate Xinglin's Record 8

Classmate Xinglin's Record 8

WBOY
Release: 2016-07-29 08:33:49
Original
925 people have browsed it

班级管理部分:
   首页:superadmin.php
include ("class/config.php");
if ($superadmin){ //如果已经进行管理员登陆,进行密码验证
if (!($supername==$supervisor)||!($superpass==$superpsw)){
echo "密码错误";
exit;
}else{ //用session记录管理员登陆
session_start(); // 开始session
session_register("superlogin");
$superlogin=$supername;
}
}else{ //管理员登陆
echo "

";
echo "
请输入管理员密码
";
echo "管理员";  
echo "
";
echo "密码";
echo "
";
echo "
";
echo "
";   
echo "
";
exit;
}
?>


班级管理



 



    
    
  
    
    
  
    
    


      

    
  
      
班级管理

    
  
      

        添加成员

        显示、删除成员

        修改成员信息

        班级留言管理

        客人留言管理




Add members: class/admin/addmember.php
session_start() ;
if(!session_is_registered("superlogin"))//Check whether it is registered
{
echo " Please log in as administrator again
";
exit;
}
include "../config.php";
if ($submit){
if (!$username||!$name){ //Check whether it is completed
All items with * must be filled in!
"."
Return";
                                                                                                                                                                               exit psw);
$name=trim($name);
$birth=$year.'-'.$month.'-'.$day;
$work=trim($work);
$ad=trim( $ad);
$post=trim($post);
$ph=trim($ph);
$bp=trim($bp);
$email=trim($email);
$oicq=trim( $oicq);
//Check whether this name has been registered
$result = mysql_query("SELECT name FROM user where name='$name'",$db);
if (mysql_num_rows($result)!=0) {
echo "This name has already been registered!"."Refill "."Forgot your password, ask the administrator for the password< /a>";
exit;
}
//Check whether the user name is used
$result = mysql_query("SELECT user FROM user where user='$username'",$db);//If the number of columns is returned If it is not 0, it means that this username has already been used.
if (mysql_num_rows($result)!=0){
echo "This username has already been used!""."
Refill";
exit;
}
//Write to database
$sql="INSERT INTO user (user,psw,name,sex,birth,work,ad ,post,ph,bp,email,oicq) VALUES ('$username','$psw','$name','$sex','$birth','$work','$ad','$ post','$ph','$bp','$email','$oicq')";
$result = mysql_query($sql,$db);
mysql_close($db);
echo "Added successfully ";
exit;
}
?>



Add member




                                                                               >

                                                 (English letters or numbers, The length should not exceed 12)

                             (English letters or numbers) , the length should not exceed 8 characters) Male
                                                                                                                                                   gt; & Birthday: l & lt; Select name = 'year' & gt;
& lt; option selectd & gt; 1991 & lt;/option & gt;
& lt; option & gt; 1990 & lt;/option & gtion & gt T & lt; option & gt; 1989 & lt;/option & gt;
& lt; option & gt; 1988
                                                                     85
  1983
                                                                     80
  1978
                                                                     75
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            
          
          年  
          
          月  
          
          日

          工作单位:  
          
          

          通讯地址:  
          
          

          邮编:  
          
          

          电话:  
          
          

          传呼:  
          
          

          Email:  
          
          

          oicq:  
          
          

           

             

          

          
          
        

      



显示、删除成员:class/admin/member.php
session_start();
if(!session_is_registered("superlogin"))//检查是否注册
{
echo "请重新进行管理员登陆
";
exit;
}
include "../config.php";
if ($del==1){
mysql_query("delete from user where user='$user'",$db); //删除
echo "删除成功!";}
?>


成员列表




    
    
  
  
    
  
    
    
  
  
      

    

      
成员列表

    

      
          
          
          
          
          
        
                  $result = mysql_query("SELECT * FROM user",$db);
          $row=mysql_num_rows($result);//查看结果有多少行
           for ($i=0;$i<=($row-1);$i++) {
   $name=mysql_result($result,$i,'name');
   $user=mysql_result($result,$i,'user');
   $psw=mysql_result($result,$i,'psw');
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";  
        }
          ?>
        
  
            
用户名

          

            
密码

          

            
姓名

          

            
删除

          
$name$psw$name删除

    



修改成员资料:class/admin/editmember.php
session_start();
if(!session_is_registered("superlogin"))//检查是否注册
{
echo "
请重新进行管理员登陆
";
exit;
}
?>


修改成员资料




  
      
      
    
  
  
        
您要修改谁的资料?

          
          

          
          
        

      




修改成员资料步骤2:class/admin/editmember_step2.php
session_start();
if(!session_is_registered("superlogin"))//检查是否注册
{
echo "
请重新进行管理员登陆
";
exit;
}
?>



修改成员资料


include "../config.php";
if ($submit){
$user=trim($username);
$psw=trim($psw);
$name=trim($name);
$birth=trim($birth);
$work=trim($work);
$ad=trim($ad);
$post=trim($post);
$ph=trim($ph);
$bp=trim($bp);
$email=trim($email);
$oicq=trim($oicq);
$phot
$account=strip_tags(trim($account));//去掉首尾空格及html标记
$signature=strip_tags(trim($signature));
//写入数据库
$sql="UPDATE user SET user='$user',psw='$psw',name='$name',sex='$sex',birth='$birth',work='$work',ad='$ad',post='$post',ph='$ph',bp='$bp',email='$email',oicq='$oicq',account='$account',signature='$signature',photo='$photoname',face='$face' where name='$member'";
$result = mysql_query($sql,$db);
mysql_close($db);
echo "恭喜您修改成功!";
exit;
}
$result = mysql_query("SELECT * FROM user where name='$member'",$db);
$user=mysql_result($result,0,"user");
$psw=mysql_result($result,0,"psw");
$sex=mysql_result($result,0,"sex");
$birth=mysql_result($result,0,"birth");
$work=mysql_result($result,0,"work");
$ad=mysql_result($result,0,"ad");
$post=mysql_result($result,0,"post");
$ph=mysql_result($result,0,"ph");
$bp=mysql_result($result,0,"bp");
$email=mysql_result($result,0,"email");
$oicq=mysql_result($result,0,"oicq");
$photo=mysql_result($result,0,"photo");
$account=mysql_result($result,0,"account");
$signature=mysql_result($result,0,"signature");
$photo=mysql_result($result,0,"photo");
$face=mysql_result($result,0,"face");
mysql_close($db);
?>

    
    
  
    
    
  
  
      

    
  
      
修改成员资料

                                                                                                                                                                                                 member=',$member;?>'>
                                                                                                                                                      name='username' size='12' maxlength='12' value="">  
                                                                                                                                                                                          No more than 8 characters)

                                                                                                                                             . ">
                                                 ;} ?>>?>>
          

          生日:

          工作单位:  
          
          

          通讯地址:  
          
              

          邮编:  
          
          

          电话:  
          
              

          传呼:  
          
          

          Email:  
          
              

          oicq:  
          
              

              个人照片:
              
              

          个人说明:(在通讯录里显示,不超过125个汉字)

          
          

          个人签名:(在留言簿的自动签名,不超过125个汉字)

              
            
            
          
        


              选择一个自己喜欢的头像:

                     for ($i=1;$i<=64;$i++){
            echo "";  
            echo "            if ($face==$i){
            echo "checked";
            }
            echo ">";
            if (($i%4)==0){ //隔4行,换行
             echo "
";
            }
           }
           ?>

            

        

          

          
          
        

      
    


 

以上就介绍了 杏林同学录八,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

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