首页
网盘
推荐
百度一下
Search
1
Chrome和Edge不能相亲相爱吗
38 阅读
2
《巨人的工具》| 万维钢解读
28 阅读
3
测试视频去水印
8 阅读
4
测试疫情地图
8 阅读
5
退出功能实现
8 阅读
PMS
笔记
软件
随笔
工作计划
登录
Search
标签搜索
php
学习
Tzz
累计撰写
36
篇文章
累计收到
4
条评论
首页
栏目
PMS
笔记
软件
随笔
工作计划
页面
网盘
推荐
百度一下
搜索到
36
篇与
Tzz
的结果
2021-10-30
PHP页面加密访问
{alert type="success"}以下代码复制保存为php文件 Test {/alert}<?php /******************************************** * 使用方法: * * 1、将本段代码保存为 MkEncrypt.php * * 2、在要加密的页面前面引入这个 php 文件 * require_once('MkEncrypt.php'); * * 3、设置页面访问密码 * MkEncrypt('页面密码'); * ********************************************/ // 密码 Cookie 加密盐 if(!defined('MK_ENCRYPT_SALT')) define('MK_ENCRYPT_SALT', 'Kgs$JC!V'); /** * 设置访问密码 * <a href="" class="return-home" title="点击回到网站首页">- 内部使用,请见谅! - </a> * @param $password 访问密码 * @param $pageid 页面唯一 ID 值,用于区分同一网站的不同加密页面 */ function MkEncrypt($password, $pageid = 'default') { $pageid = md5($pageid); $md5pw = md5(md5($password).MK_ENCRYPT_SALT); $postpwd = isset($_POST['pagepwd']) ? addslashes(trim($_POST['pagepwd'])) : ''; $cookiepwd = isset($_COOKIE['mk_encrypt_'.$pageid]) ? addslashes(trim($_COOKIE['mk_encrypt_'.$pageid])) : ''; if($cookiepwd == $md5pw) return; // Cookie密码验证正确 if($postpwd == $password) { // 提交的密码正确 time()+3600*24*3 setcookie('mk_encrypt_' . $pageid, $md5pw, time() + 3600000, '/'); //setcookie('mk_encrypt_' . $pageid, $md5pw, time() + 3600*24*3, '/'); setcookie('mk_encrypt_' . $pageid, $md5pw, time() + 36000, '/'); return; } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="renderer" content="webkit"> <meta name="author" content="mengkun"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>该页面已被加密</title> <style type="text/css"> *{font-family:"Microsoft Yahei",微软雅黑,"Helvetica Neue",Helvetica,"Hiragino Sans GB","WenQuanYi Micro Hei",sans-serif;box-sizing:border-box;margin:0px;padding:0px;font-size:14px;-webkit-transition:.2s;-moz-transition:.2s;-ms-transition:.2s;-o-transition:.2s;transition:.2s} html,body{width:100%;height:100%} body{background-color:#F4F6F9;color:#768093} input,button{font-size:1em;border-radius:3px;-webkit-appearance:none} input{width:100%;padding:5px;box-sizing:border-box;border:1px solid #e5e9ef;background-color:#f4f5f7;resize:vertical} input:focus{background-color:#fff;outline:none} button{border:0;background:#6abd09;color:#fff;cursor:pointer;opacity:1;user-select:none} button:hover,button:focus{opacity:.9} button:active{opacity:1} .main{width:100%;max-width:500px;height:300px;padding:30px;background-color:#fff;border-radius:2px;box-shadow:0 10px 60px 0 rgba(29,29,31,0.09);transition:all .12s ease-out;position:absolute;left:0;top:0;bottom:0;right:0;margin:auto;text-align:center} .alert{width:80px} .mk-side-form{margin-bottom:28px} .mk-side-form input{float:left;padding:2px 10px;width:77%;height:37px;border:1px solid #ebebeb;border-right-color:transparent;border-radius:2px 0 0 2px;line-height:37px} .mk-side-form button{position:relative;overflow:visible;width:23%;height:37px;border-radius:0 2px 2px 0;text-transform:uppercase} .pw-tip{font-weight:normal;font-size:26px;text-align:center;margin:25px auto} #pw-error {color: red;margin-top: 15px;margin-bottom: -20px;} .return-home{text-decoration:none;color:#b1b1b1;font-size:16px} .return-home:hover{color:#1E9FFF;letter-spacing:5px} </style> </head> <body> <div class="main"> <svg class="alert" viewBox="0 0 1084 1024" xmlns="http://www.w3.org/2000/svg" width="80" height="80"> <defs><style/></defs> <path d="M1060.744 895.036L590.547 80.656a55.959 55.959 0 0 0-96.919 0L22.588 896.662a55.959 55.959 0 0 0 48.43 83.907h942.14a55.959 55.959 0 0 0 47.525-85.534zm-470.619-85.172a48.008 48.008 0 1 1-96.015 0v-1.567a48.008 48.008 0 1 1 96.015 0v1.567zm0-175.345a48.008 48.008 0 1 1-96.015 0V379.362a48.008 48.008 0 1 1 96.015 0v255.157z" fill="#FF9800"/> </svg> <form action="" method="post" class="mk-side-form"> <h2 class="pw-tip">该页面已被加密</h2> <input type="password" name="pagepwd" placeholder="请输入访问密码查看" required><button type="submit">提交</button> <?php if($postpwd): ?> <p id="pw-error">Oops!密码不对哦~</p> <script>setTimeout(function() {document.getElementById("pw-error").style.display = "none"}, 2000);</script> <?php endif; ?> </form> <h1 class="" class="return-home" title="">内部使用,请见谅!</h1> </div> </body> </html> <?php exit(); }{alert type="success"}以下代码复制在需要加密的index页面内{/alert}require_once('MkEncrypt.php'); //引入加密文件,如果这个引入无效可以使用:include("MkEncrypt.php"); 来引入(注意文件目录正确) require_once('MkEncrypt.php'); MkEncrypt('123456'); //访问当前页面的密码(这里密码为123456 自行修改即可) MkEncrypt('123456');
2021年10月30日
4 阅读
0 评论
0 点赞
2021-10-06
《思考,快与慢》
{timeline}{timeline-item color="#19be6b"}2021-10-06 12:44:31 星期三{card-list}{card-list-item}每一个人的大脑里都存在系统1和系统2,对于日常问题,用系统1就可以做出直觉判断;对于复杂问题,需要系统2发挥理性,用慢思考来解决问题。系统1与系统2处于一种分工合作的状态,如果能实现合理分工合作,人的思考将会事半功倍。{/card-list-item}{/card-list}{alert type="success"}人类的双系统思考模式:系统1是直觉系统,运行时无意识,产生快思考。系统2是非直觉系统,运行需要主动控制,保持足够专注,产生慢思考。决策风险:系统1的直觉式快思考,会引起偏见和失误,使得传统经济学的理性经济人假设失效。怎么办:需要放慢思考,主动激活系统2,对系统1的直觉思考结果进行理性检验,减少偏见和失误。{/alert}{/timeline-item}{/timeline}
2021年10月06日
4 阅读
0 评论
0 点赞
2021-03-04
此内容被密码保护
加密文章,请前往内页查看详情
2021年03月04日
8 阅读
0 评论
2 点赞
2021-01-20
此内容被密码保护
加密文章,请前往内页查看详情
2021年01月20日
17 阅读
0 评论
0 点赞
2020-12-15
《巨人的工具》| 万维钢解读
巨人的工具"]这本书里三个优秀的大人物告诉我们,不要去追求实现一个什么具体的“目标”,而要发展一个“系统”;真正的自由是自律,是你要对你的世界有极端所有权;生活中的挑战应接不暇,你应该学会优先应对进攻型挑战。
2020年12月15日
28 阅读
0 评论
0 点赞
2020-11-23
Chrome和Edge不能相亲相爱吗
暂无简介
2020年11月23日
38 阅读
0 评论
0 点赞
1
...
5
6