关闭redis持久化功能

关闭redis持久化功能
持久化会报如下信息
会影响硬盘写入性能 所以没什么用 就关掉吧

修改redis配置文件,redis.conf 第115行左右。

1.注释掉原来的持久化规则

#save 900 1
#save 300 10
#save 60 10000

2.设置为空

save ""

然后重启redis服务即可。

ps:linux RDB: 10 MB of memory used by copy-on-write 一般说明内存不够用了

网站提示“访问网站包含恶意软件”怎么申诉移除

网站提示“访问网站包含恶意软件”怎么申诉移除
http://jingyan.baidu.com/article/c1465413922aa50bfcfc4c39.html
看这个
贴一下站长工具地址https://www.google.com/webmasters/tools/home?hl=zh-TW&pli=1
进去验证好以后要点击安全问题 然后审核就可以了

IP address ‘121.41.35.30’ could not be resolved: Name or service not known解决方法

IP address ‘121.41.35.30’ could not be resolved: Name or service not known解决方法

添加如下 然后重启 即可解决

[mysqld] 
skip-name-resolve

如果报如下错误
2017-05-09 16:44:25 21224 [Warning] ‘user’ entry ‘root@izbp11xke8lva3xk8b3qtnz’ ignored in –skip-name-resolve mode.
2017-05-09 16:44:25 21224 [Warning] ‘user’ entry ‘@izbp11xke8lva3xk8b3qtnz’ ignored in –skip-name-resolve mode.
2017-05-09 16:44:25 21224 [Warning] ‘proxies_priv’ entry ‘@ root@izbp11xke8lva3xk8b3qtnz’ ignored in –skip-name-resolve mode.

直接去mysql数据库里面 user表里删除izbp11xke8lva3xk8b3qtnz 用户 还有proxies_priv删除izbp11xke8lva3xk8b3qtnz用户
然后重启mysql即可

jquery ajax分页写法

jquery ajax分页写法
我用的是laypage插件

前端代码

        function demo(curr) {
            $.getJSON('/home/index/getinfo', {
                page: curr || 1 //向服务端传的参数,此处只是演示
            }, function (res) {
                var html = '';
                var list = res.data.list;
                $.each(list, function (k, v) {
                    html += '<div';
                    if(k%2==0){
                        html += ' style="margin-left:0px;"';
                    }
                    html += ' class="perinfocontent" onclick="window.location.href=\'content.html?id='+v['id']+'\'">';
                    html += '<img src="'+v['fengmiantu']+'" alt="" class="pic">';
                    html += '<div class="infos">';
                    html += '<div class="title">'+v['title']+'</div>';
                    html += '<div class="tiyao">'+v['content']+'</div>';
                    html += '<div class="publishtime">2017 / 1 / 23</div>';
                    html += '</div>';
                    html += '</div>';
                });

                $('.infocontent').html(html);

                //显示分页
                laypage({
                    cont: $('#page3'), //容器。值支持id名、原生dom对象,jquery对象,
                    pages: res.data.pagecount, //总页数
                    skip: true, //是否开启跳页
                    skin: 'molv',
                    curr: curr || 1, //当前页
                    jump: function (obj, first) { //触发分页后的回调
                        if (!first) { //点击跳页触发函数自身,并传递当前页:obj.curr

                        demo(obj.curr);
                        }
                    }
                });

            });
        };
//运行
        demo();

PHP代码

    public function getinfo(){
        $page = intval($_GET['page']);
     
        if(empty($page)){
            $page=1;
        }
        $startpos=$page-1;
        //返回每页的数据
        $percount = 8;
        $VModel = new HuanShanVoteModel();
        $sql = 'select * from wz_content order by id desc limit '.$startpos*$percount.',' . $percount;

        $result = $VModel->query($sql);
        foreach ($result as $k => $v) {
            $result[$k]['content'] = substr(stripHTML(htmlspecialchars_decode($v['content'])), 0, 30) . '......';
            $result[$k]['time'] = date('Y / M / D', $v['time']);
        }

        //返回总页码数
        $VModel = new HuanShanVoteModel();
        $sql = 'select title,content from wz_content';
        $alllist = $VModel->query($sql);
        $count = count($alllist);
        $pagecount = ceil($count / $percount);

        echo json_encode(array('success'=>1,'msg'=>'查询成功','data' => array('pagecount' => $pagecount, 'list' => $result)));
        exit();
    }