phpcms毛遂

简介: 1.showmessage() showmessage(L('operation_success'),'?m=link&c=link&a=edit','', 'edit'); edit==>关闭对象 showmessage(L('operation_fa...
1.showmessage()

    showmessage(L('operation_success'),'?m=link&c=link&a=edit','', 'edit');

    edit==>关闭对象

    showmessage(L('operation_failure'));

    showmessage(L('operation_false'),HTTP_REFERER);


2.formValidator



3.update()
    $data=array('nickname'=>$_POST['nickname'],'contact'=>$_POST

['contact'],'content'=>$_POST['content'],'posttime'=>time(),'checkinfo'=>$checkinfo);
            
            $result=$this->db->update($data,"id={$id}");

    $result=$this->db->delete("id={$_GET['id']}");

    $insert_id=$this->db->insert($data,true);

4.数据表名


5.listinfo()



6.对话框
    function edit(id) {
        window.top.art.dialog({id:'edit'}).close();
        window.top.art.dialog({title:'编辑留言'+' ',id:'edit',iframe:'?

m=board&c=board&a=edit&id='+id,width:'700',height:'450'}, function(){var d = 

window.top.art.dialog({id:'edit'}).data.iframe;
        var form = d.document.getElementById('dosubmit');form.click();return false;}, 

function(){window.top.art.dialog({id:'edit'}).close()});
    }
    
    function replay(id) {
        window.top.art.dialog({id:'replay'}).close();
        window.top.art.dialog({title:'回复留言'+' ',id:'replay',iframe:'?

m=board&c=board&a=replay&id='+id,width:'450',height:'200'}, function(){var d = 

window.top.art.dialog({id:'replay'}).data.iframe;
        var form = d.document.getElementById('dosubmit');form.click();return false;}, 

function(){window.top.art.dialog({id:'replay'}).close()});
    }



7.改变状态的ajax

    //传id和值
    function check(id,checkinfo){
        $.ajax({
            type:"get",
            url:"?m=board&c=board&a=check",
            data:{id:id,checkinfo:checkinfo},
            dataType:"json",
            success:function(data){
                window.location="?m=board&c=board&a=init";
            }
        })

    }


    public function check(){
        if($_GET['checkinfo']=="true"){
            $checkinfo="false";
        }else{
            $checkinfo="true";
        }
        $data=array("checkinfo"=>$checkinfo);
        $result=$this->db->update($data,"id={$_GET['id']}");
        if($result){
            echo "1";
        }
        
    }



7.删除全部
    <a href='?m=board&c=board&a=delete&id=<?php echo $info['id']?>' onClick="return 

confirm('<?php echo L('confirm', array('message' =>$info['id']))?>')">删除</a> 


    public function delete(){
        if(!is_array($_POST['id'])){
            $result=$this->db->delete("id={$_GET['id']}");
            if($result){
                showmessage(L('operation_success'),HTTP_REFERER);
            }else{
                showmessage(L('operation_failure'),HTTP_REFERER);
            }
        }else{
            foreach($_POST['id'] as $k=>$smple_id){
                $result=$this->db->delete("id={$smple_id}");
                if(!$result){
                    showmessage(L('operation_failure'),HTTP_REFERER);
                }
            }
            showmessage(L('operation_success'),HTTP_REFERER);
        }
    }


8.排序
    <input name="dosubmit" type="submit" class="button" onClick="document.myform.action='?

m=board&c=board&a=listorder'" value="<?php echo L('listorder')?>">


//更新排序
     public function listorder() {
        if(isset($_POST['dosubmit'])) {
            foreach($_POST['listorders'] as $id => $orderid) {
                $orderid= intval($orderid);
                $this->db->update(array('orderid'=>$orderid),array('id'=>$id));
            }
            showmessage(L('operation_success'),HTTP_REFERER);
        } 
    }

 

目录
相关文章
|
3月前
|
安全 PHP 开发者
phpcms上传导致getshell详解及案例
通过上传功能实现getshell是攻击者常用的一种手段,针对PHP CMS或其他类型的CMS,开发者和管理员都应意识到安全风险,采取有效措施加以防范。只有不断更新知识库、审计网站安全和实施最佳安全实践,才能在这场永无止境的安全防御战中站稳脚跟。
21 0
|
5月前
|
数据可视化 UED
WordPress和phpcms
【4月更文挑战第24天】WordPress
44 2
|
PHP 数据库 数据安全/隐私保护
phpcms服务器搭建之 phpcms的安装
phpcms服务器搭建之 phpcms的安装
121 0
|
缓存
phpcms之 为每个栏目添加一个模块
phpcms之 为每个栏目添加一个模块
|
Web App开发 缓存 数据安全/隐私保护
phpcms服务器搭建之 phpcms网站基本介绍
phpcms服务器搭建之 phpcms网站基本介绍
113 0
|
缓存 前端开发
phpcms之 轮播图的添加
phpcms之 轮播图的添加
118 1
|
Apache
phpcms之 解决无法远程访问服务器端的phpcms问题
phpcms之 解决无法远程访问服务器端的phpcms问题
|
缓存
phpcms之 文件下载的页面
phpcms之 文件下载的页面
|
缓存 前端开发 JavaScript
phpcms之 如何把自己的静态模板套入到phpcms模板
phpcms之 如何把自己的静态模板套入到phpcms模板
|
API PHP 数据安全/隐私保护