6.21留言板

6.21留言板_第1张图片

6.21留言板_第2张图片




    
    
    
    
    
    
    Document


    开发区内部留言板
    
帐号:
口令:
Document
class="title">
class="title_box"> 开发部内部留言板
class="nav">
class="nav_box">
class="nav_but">返回首页
class="nav_but" οnclick="zhuxiao()">退出系统
class="nav_text">echo $_SESSION["uid"];?> 欢迎您登陆本系统
class="room">
class="room_boxa">
class="room_but" class="btn btn-primary" data-toggle="modal" data-target="#myModal">发布信息
class="room_but" οnclick="chakan()">查看信息
class="room_but" οnclick="zhuxiao()">注销
class="room_boxb">
class="room_room"> class="room_count table">
class="modal fade" id="myModal">
class="modal-dialog">
class="modal-content">
class="modal-header">

class="modal-title">模态框头部

class="modal-body">

信息发送

接收人:
信息内容:
class="modal-footer">
php
    session_start();
    $type = $_POST['type'];
    $conn = new mysqli("localhost","root","","ceshi2");
    $conn->connect_error?die("链接失败"):"";
    switch($type){
        case "denglu":
        $uid = $_POST["uid"];
        $pwd = $_POST["pwd"];
        $sql = "select * from yuangong where UserName = '{$uid}' and PassWord = '{$pwd}'";
        $result=$conn->query($sql);
        $attr=$result->fetch_all();
        if($attr != null){
            $_SESSION["uid"] = $uid; 
            echo "ok";
            }
            else if($attr == null){
                echo "no";
            };  
        break;
        case "chakan":
        $uid = $_SESSION["uid"];
        $sql = "select * from liuyan where Recever = '{$uid}' or Recever='all'" ;
        $result = $conn->query($sql);
        $attr = $result->fetch_all();
        echo json_encode($attr);
        break;
        
        case "zhuxiao":
        session_destroy(); 
        break;
        
        case "zhuce":
        $uid = $_POST["uid"];
        $sql ="select username from yuangong where username='{$uid}'";
        $result = $conn->query($sql);
        $attr = $result->fetch_row();
        if($attr != null){
            echo "cf";
        };
        break;
        
         
        case "fabu":
        $sender = $_SESSION["uid"];
        $rec = $_POST["rec"];
        $com = $_POST["com"];
        $time = date("Y-m-d H:i:s",time()); 
        $sql = "insert into LiuYan values('','{$sender}','{$rec}','{$time}','{$com}','')";     
        if($result = $conn->query($sql)){
                 echo "ok";
        }
        break;
        
    }
    
    
?>

 

转载于:https://www.cnblogs.com/sunhao1987/p/9210861.html

你可能感兴趣的:(6.21留言板)