{"title":"PHP为任意页面设访问密码,需要登陆才能访问","content":"---\ntitle: 'PHP为任意页面设访问密码,需要登陆才能访问'\ndate: 2022-03-01 06:45:11\ntags: []\npublished: true\nhideInList: false\nfeature: \nisTop: false\n---\n使用方法\n把下面的代码存为php文件,下面的整段代码是验证过程,然后在你入口页进行调用\n例如命名为MkEncrypt.php,那么在入口页调用\n\n //调用文件\n require_once('MkEncrypt.php');\n //然后设置密码为\n MkEncrypt('1234');\n\n![](https://s3.bmp.ovh/imgs/2022/03/ef6105635da0d3eb.png)\n\n代码如下\n\n \n \n \n \n \n \n \n \n \n 该页面已被加密\n \n \n \n
\n \n \n \n \n \n
\n

该页面已被加密

\n \n \n

Oops!密码不对哦~

\n \n \n
\n - 返回首页 - \n
\n \n \n