Home > Backend Development > PHP Tutorial > Forum based on mysql (5)_PHP tutorial

Forum based on mysql (5)_PHP tutorial

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

## manage_read.php
require ("func.php");
if (check_admin_password()) {
    $board=$jl_forum[board];
    switch ($job){
        case "setgood":
            set_good($jl_forum[board],$uid);
            $work=1;
            break;
        case "setnogood":
            set_no_good($jl_forum[board],$uid);
            $work=1;
            break;
        case "delete":
            del_doc($jl_forum[board],$uid);
            $work=1;
            break;
    }
if (!$word) {
    add_one_hit($board,$id);
}
$sql="select * from $board where id=$id";
$sql_result=mysql_query($sql);
$sum=mysql_num_rows($sql_result);
$sql_row=mysql_fetch_array($sql_result);
$title=$sql_row[title];
$writer=$sql_row[writer];
$cont=$sql_row[cont];
$writetime=$sql_row[writetime];
$hits=$sql_row[hits];
$good=$sql_row[good];
$rootid=$sql_row[id];
$fromip=$sql_row[fromip];
$sql="select * from $board where slaveid=$id";
$sql_result=mysql_query($sql);
if ($sum<>0) {
?>


<?php echo $title;?>












  
    
  
  
    
  
  
    
  
  
    
  
标题: ◎操作:";?>转进精华区 ";?>删除if ($good=="y"){
?>
";?>转出精华区  
      }
?>
作者:(,点击:) ')">给作者留言 察看用户资料
※ 来源: [◆FROM:]



if (!$add){
while($sql_row=mysql_fetch_array($sql_result)) {
$good=$sql_row[good];
?>

  
    
  
  
    
  
  
    
  
  
    
  
标题:    $id=$sql_row[id];
    ?> ◎操作:
";?>转进精华区 ";?>删除if ($good=="y"){
?>
";?>转出精华区  
      }
?>
作者:() ')">给作者留言 ">察看用户资料
※ 来源: [◆FROM:]

}
}
?>





}
else {
echo "This record has been deleted";
}
}
else {
show_error(1);
}
?>
## modify.php
require "func.php";
if (check_user_password($jl_forum[name],$jl_forum[password])) {
$name=$jl_forum[name];
$password=$jl_forum[password];
$sql="select * from user where name='$name'";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
?>


修改资料








修改用户个人资料

  
      
      
    
      
      
    
  
 
  
        

          
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
              
              
              
            
          
用户名
密码   
                
                *
重复密码   
                
                *
Email   
                
                *
性别   
                
              
真实性名   
                
              
地址   
                
              
电话   
                
              
主页   
                
              
OICQ   
                
              
签名 ";?>  
                
              
    
                
                
              

        

      

  


  





}
else {
show_error(4);
}
?>
## modify_l.php
require "func.php";
if ($b1) {
if (is_user_exits($name) and check_user_password($name,$password)) {
setcookie ("jl_forum[name]",$name);
setcookie ("jl_forum[password]",$password);
redirect2("modify.php");
}
else {
show_error(4);
}
}
else {
?>


main






    
    
  
    
    
  
    
    
  
    
    
  

      
修改资料登陆

    

      

        
          
            
            
          
          
            
            
          
        
用户名:
              
            
密码:
              
            

        
      

    

      
论坛信息

    
  

    



}
?>
## oper.php
require "func.php";
if (adminok()) {
    if (isset($add_board)) {
        if (isset($name) and isset($chinesename) and !is_board_exits($name)) {
            create_board_table($name,$chinesename);
        }
        else {
            echo "出现错误!(可能版面已经存在)";
            $founderr=1;
        }
    }
    elseif (isset($del_board)) {
        if (isset($board)) {
            drop_board_table($board);
        }
        else {
            echo "出现错误!(请选择要删除的版面)";
            $founderr=1;
        }
    }
    elseif (isset($modify)) {
        if (isset($name) and isset($chinesename)) {
            update_board($name,$chinesename);
        }
        else {
            echo "出现错误!(请填写完整)";
            $founderr=1;
        }
    }
    elseif (isset($add_admin)) {
        if (is_user_exits($name) and isset($board)) {
            add_admin($board,$name);
        }
        else {
            echo "出现错误!(极有可能是用户不存在)";
            $founderr=1;
        }
    }
    elseif (isset($delete_admin)) {
        if (is_user_exits($name)) {
            del_admin($name);
        }
        else {
            echo "出现错误!(极有可能是用户不存在)";
            $founderr=1;
        }
    }
    else {
        echo "你要干什么?";
        $founderr=1;
    }
    if (!$founderr) {
        redirect2("admin.php");
    }
}
else {
    show_error(1);
}
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316370.htmlTechArticle## manage_read.php ?php require (func.php); if (check_admin_password()) { $board=$jl_forum[board]; switch ($job){ case setgood: set_good($jl_forum[board],$uid); $work=1; break; case...
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