LBZCC

发现更多乐趣!

11

2025年07月01日
<script>
var marquee = function (r) {
function t() {
return b[Math.floor(Math.random() * b.length)]
}
function e() {
return String.fromCharCode(94 * Math.random() + 33)
}
function n(r) {
for (var n = document.createDocumentFragment(), i = 0; r > i; i++) {
var l = document.createElement("span");
l.textContent = e(), l.style.color = t(), n.appendChild(l)
}
return n
}
function i() {
var t = o[c.skillI];
c.step ? c.step-- : (c.step = g, c.prefixP < l.length ? (c.prefixP >= 0 && (c.text += l[c.prefixP]), c.prefixP++) : "forward" === c.direction ? c.skillP < t.length ? (c.text += t[c.skillP], c.skillP++) : c.delay ? c.delay-- : (c.direction = "backward", c.delay = a) : c.skillP > 0 ? (c.text = c.text.slice(0, -1), c.skillP--) : (c.skillI = (c.skillI + 1) % o.length, c.direction = "forward")), r.textContent = c.text, r.appendChild(n(c.prefixP < l.length ? Math.min(s, s + c.prefixP) : Math.min(s, t.length - c.skillP))), setTimeout(i, d)
}
var l = "永远他妈的",
o = ["热泪盈眶.", "百感交集.","声泪俱下.", "情不自禁.", "心潮澎湃.","感慨万千.","悲喜交加.","心潮起伏."].map(function (r)
{
return r + ""
}), a = 2, g = 1, s = 5, d = 75,
b = ["rgb(110,64,170)", "rgb(150,61,179)", "rgb(191,60,175)", "rgb(228,65,157)", "rgb(254,75,131)", "rgb(255,94,99)", "rgb(255,120,71)", "rgb(251,150,51)", "rgb(226,183,47)", "rgb(198,214,60)", "rgb(175,240,91)", "rgb(127,246,88)", "rgb(82,246,103)", "rgb(48,239,130)", "rgb(29,223,163)", "rgb(26,199,194)", "rgb(35,171,216)", "rgb(54,140,225)", "rgb(76,110,219)", "rgb(96,84,200)"],
c = {text: "", prefixP: -s, skillI: 0, skillP: 0, direction: "forward", delay: a, step: g};
i()
};
marquee(document.getElementById('marquee'));
</script>
<div id="marquee"></div>

PHP页面密码保护

2025年06月21日
这段代码是一个简单的 PHP 页面密码保护系统,名为:MkEncrypt。下面我将详细解释其功能和用途:
<img src="tuchuang/uploads/6855904f21e497.39372398.png" alt="文章图片"></img>
<h2>主要功能</h2>
这段代码提供了一个简单的方法来为网页添加密码保护,要求访问者输入正确密码才能查看页面内容。
<h3>功能流程</h3>
<ol>
<li><p><strong>处理密码和标识符</strong></p>
<ul>
<li><p>对页面ID进行MD5哈希处理</p></li>
<li><p>对用户密码进行双重MD5哈希(密码+盐值)</p></li>
</ul></li>
<li><p><strong>验证逻辑</strong></p>
<ul>
<li><p>首先检查Cookie中是否存储了正确的密码哈希</p></li>
<li><p>如果Cookie验证通过,直接返回,显示页面内容</p></li>
<li><p>如果提交了表单密码($_POST['pagepwd']),验证是否正确</p>
<ul>
<li><p>正确则设置Cookie并返回</p></li>
<li><p>错误则显示错误信息</p></li>
</ul></li>
</ul></li>
<li><p><strong>密码验证失败</strong></p>
<ul>
<li><p>如果密码验证失败,显示一个密码输入页面</p></li>
<li><p>这个页面包含:</p>
<ul>
<li><p>警告图标</p></li>
<li><p>标题&quot;该页面已被加密&quot;</p></li>
<li><p>密码输入框</p></li>
<li><p>提交按钮</p></li>
<li><p>错误提示(如果密码错误)</p></li>
<li><p>返回链接</p></li>
</ul></li>
</ul></li>
</ol>
<h3>使用方法</h3>
<ol>
<li><p>将代码保存为 <code>MkEncrypt.php</code></p></li>
<li><p>PHP代码中包含文件语句,用于引入 MkEncrypt.php 文件</p></li>
<li><p>在需要加密的页面引入该文件:</p></li>
<li><p>设置页面访问密码:</p></li>
<h5>完整代码</h5>
<div class="container">
<div class="textarea-container">
<textarea id="content" name="content" rows="3" placeholder="输入文章内容..." readonly class="wenbentextarea">
<?php
require_once('MkEncrypt.php');//文件路径
MkEncrypt('页面密码');//访问密码
?>
</textarea>
<button id="copyBtn" class="btn-copy">
<i class="fa fa-copy"></i> 复制内容
</button>
</div>
<div class="stats">
<div>字符数: <span id="charCount">0</span></div>
<div>单词数: <span id="wordCount">0</span></div>
<div>行数: <span id="lineCount">0</span></div>
</div>
<div id="status" class="status"></div>
</div>
</ol>
<h2>代码</h2>
<div class="container">
<div class="textarea-container">
<textarea id="content" name="content" rows="55" placeholder="输入文章内容..." readonly class="wenbentextarea">
<?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');

/**
* 设置访问密码
*
* @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) { // 提交的密码正确
setcookie('mk_encrypt_' . $pageid, $md5pw, time() + 3600000, '/');
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>
<a href="https://baidu.com" class="return-home" title="想知道密码是多少点击我">- 密码获取 - </a>
</div>
</body>
</html>
<?php
exit();
}
</textarea>
<button id="copyBtn" class="btn-copy">
<i class="fa fa-copy"></i> 复制内容
</button>
</div>
<div class="stats">
<div>字符数: <span id="charCount">0</span></div>
<div>单词数: <span id="wordCount">0</span></div>
<div>行数: <span id="lineCount">0</span></div>
</div>
<div id="status" class="status"></div>
</div>

KaiGe软件资源导航站源码

2025年06月20日
<img src="https://lbz.cc/tuchuang/uploads/685537278e73d7.72357458.png" alt="文章图片"></img>
一个精美的软件资源导航网站,采用粉白可爱主题设计,为用户提供丰富的专业软件资源。
<a href="https://lbz.cc/wangpan/index.php?download=KaiGe%E8%BD%AF%E4%BB%B6%E8%B5%84%E6%BA%90%E5%AF%BC%E8%88%AA%E7%AB%99%E6%BA%90%E7%A0%81.zip&code=CFLB" class="download-btn" download >点击下载</a>

php多功能时钟应用

2025年06月14日
<h2>闹钟</h2>
<img src="/tuchuang/uploads/684c6cebdff812.60115168.png" alt="文章图片"></img>
<h2>秒表</h2>
<img src="/tuchuang/uploads/684c6cebdff6d5.39392892.png" alt="文章图片"></img>
<h2>计时器</h2>
<img src="/tuchuang/uploads/684c6cebdff2c0.49890726.png" alt="文章图片"></img>
<h2>功能介绍</h2>
<ol>
<li>闹钟系统优化:
<ul>
<li>更精确的闹钟触发检测(每秒检查一次)</li>
<li>添加了 "稍后提醒" 功能(5 分钟后再次触发)</li>
<li>闹钟触发后会标记为已触发状态(视觉样式变化)</li>
<li>显示闹钟日期信息,区分今天和过去的闹钟</li>
</ul>
</li>
<li>界面改进:
<ul>
<li>优化了整体布局和视觉效果</li>
<li>添加了更多动画和过渡效果</li>
<li>改进了闹钟列表的视觉区分(今天的闹钟有特殊标记)</li>
<li>计时器增加了圆形进度环显示</li>
</ul>
</li>
<li>功能增强:
<ul>
<li>秒表增加了百分之一秒的显示精度</li>
<li>所有功能区都有更完善的空状态提示</li>
<li>改进了音频播放的用户体验和错误处理</li>
<li>添加了当前日期显示</li>
</ul>
</li>
</ol>
<a href="https://lbz.cc/wangpan/index.php?download=php%E5%A4%9A%E5%8A%9F%E8%83%BD%E6%97%B6%E9%92%9F%E5%BA%94%E7%94%A8.zip&code=208q" class="download-btn" download >点击下载</a>

PHP随机码生成器源码

2025年06月08日
<blockquote>改源码用AI生成</blockquote>
<img src="/tuchuang/uploads/68451f0d514c33.12738004.png" alt="文章图片"></img>

<h2>一、核心功能概述</h2>
<p>该源码实现了一个 四位数随机码生成系统,具备以下核心能力:</p>
<ol>
<li><strong>生成唯一随机码</strong>:每次点击按钮生成不重复的 4 位随机码(数字 + 大小写字母混合)。</li>
<li><strong>存储与管理</strong>:将生成的随机码及其生成时间保存到文件中,支持历史记录查询和统计。</li>
<li><strong>友好的用户界面</strong>:通过 HTML/CSS 实现响应式设计,包含导航栏、生成按钮、历史记录表格和统计信息。</li>
</ol>
<h2>二、技术栈与文件结构</h2>
<ul>
<li><strong>后端</strong>:PHP(处理逻辑、文件操作)。</li>
<li><strong>前端</strong>:HTML/CSS(界面布局与样式)、JavaScript(交互效果,如复制功能、导航栏滚动效果)。</li>
<li><strong>存储</strong>:文本文件 <code>codes.txt</code>(存储随机码和生成时间)。</li>
</ul>
<h2>三、关键功能模块分析</h2>
<p>1. 随机码生成逻辑</p>
<ul class="auto-hide-last-sibling-br">
<li>字符集:
<pre>
<code>使用 0-9、a-z、A-Z 共 62 个字符,可生成 \(62^4 = 14,776,336\) 种组合。</code>
</pre>
</li>
<li><strong>生成函数</strong>
<pre>
<code>function generateRandomCode() {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$code = '';
for ($i = 0; $i < 4; $i++) {
$code .= $characters[rand(0, strlen($characters) - 1)]; // 随机选取字符
}
return $code;
}</code>
</pre>
</li>
<li>唯一性校验:通过 getUniqueCode 函数确保新生成的码不在已存在的列表中,避免重复。</li>
</ul>
<p>2. 文件存储与读取</p>
<ul>
<li>存储格式:每行存储一个随机码及其生成时间,格式为 CODE|YYYY-MM-DD HH:mm:ss,例如:</li>
<pre>
<code>Ab34|2025-06-08 12:34:56
Xy78|2025-06-08 12:35:10</code>
</pre>
<li>读取函数:
<pre>
<code>
function readExistingCodes() {
// 从文件读取内容并解析为数组,包含 code、datetime、timestamp(时间戳用于排序)
}
</code>
</pre>
</li>
<li>写入函数:使用 FILE_APPEND 模式追加新记录,确保文件操作的原子性和安全性。</li>
</ul>
<p>3. 前端界面设计</p>
<ul>
<li>导航栏:显示已生成的随机码总数,滚动时添加毛玻璃效果(scrolled 类)。</li>
<li>生成卡片:包含大字体显示当前随机码、生成按钮,支持点击复制功能(JavaScript 实现)。</li>
<li>历史记录表格:显示最近 10 条记录,按生成时间倒序排列,包含序号、随机码、格式化时间。</li>
<li>统计信息:
<ul>
<li>总生成数量:直接统计文件中的记录数。</li>
<li>上次更新时间:取最新记录的时间。</li>
<li>可用组合数:计算剩余可生成的组合数(62<sup>4</sup>- 已生成数量)。</li>
</ul>
</li>
</ul>
<p>4. 交互功能</p>
<ul>
<li><strong>复制随机码</strong>:点击随机码区域,通过navigator.clipboard 实现复制,并弹出提示框。</li>
<li><strong>导航栏滚动效果</strong>:通过 JavaScript 监听滚动事件,动态切换类名实现背景模糊效果。</li>
<li><strong>提示消息</strong>:使用固定定位的 toast 提示框,显示复制成功等信息,3 秒后自动消失。</li>
</ul>

<a href="https://lbz.cc/wangpan/?download=PHP%E9%9A%8F%E6%9C%BA%E7%A0%81%E7%94%9F%E6%88%90%E5%99%A8%E6%BA%90%E7%A0%81.zip&code=pAjG" class="download-btn" download >点击下载</a>



关于博主

L

LBZCC的博主

热爱写作与分享

欢迎来到我的个人博客!这里记录我的思考、经验和生活点滴。希望我的文章能给您带来一些启发或帮助。