if (isset($_POST['agree'])) { // 判断 POST 请求中的 cid 是否是本篇文章的 cid if ($_POST['agree'] == $this->cid) { // 调用点赞函数,传入文章的 cid,然后通过 exit 输出点赞数量 exit(agree($this->cid)); } // 如果点赞的文章 cid 不是本篇文章的 cid 就输出 error 不再往下执行 exit('error'); }

禁止F12调试chrome

   function endebug(off, code) {
            if (!off) {
                !function (e) {
                    function n(e) {
                        function n() {
                            return u
                        }
                        function o() {
                            window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized ? t("on") : (a = "off", console.log(d), console.clear(), t(a))
                        }
                        function t(e) {
                            u !== e && (u = e, "function" == typeof c.onchange && c.onchange(e))
                        }
                        function r() {
                            l || (l = !0, window.removeEventListener("resize", o), clearInterval(f))
                        }
                        "function" == typeof e && (e = {
                            onchange: e
                        });
                        var i = (e = e || {}).delay || 500,
                            c = {};
                        c.onchange = e.onchange;
                        var a, d = new Image;
                        d.__defineGetter__("id", function () {
                            a = "on"
                        });
                        var u = "unknown";
                        c.getStatus = n;
                        var f = setInterval(o, i);
                        window.addEventListener("resize", o);
                        var l;
                        return c.free = r, c
                    }
                    var o = o || {};
                    o.create = n, "function" == typeof define ? (define.amd || define.cmd) && define(function () {
                        return o
                    }) : "undefined" != typeof module && module.exports ? module.exports = o : window.jdetects = o
                }(), jdetects.create(function (e) {
                    var a = 0;
                    var n = setInterval(function () {
                        if ("on" == e) {
                            setTimeout(function () {
                                if (a == 0) {
                                    a = 1;
                                    setTimeout(code);
                                }
                            }, 200)
                        }
                    }, 100)
                })
            }
        }

        endebug(false, function () {
            document.write('<div style="text-align:center;color:red">检测到非法调试,请关闭后刷新访问</div>');
        });
      </script>

禁止F12调试chrome

来都来了,留个言吧🙂