一、详细介绍
压缩包里有多少个php就会被加密多少个PHP、php无需安装任何插件。源码全开源
如果上传的压缩包里有子文件夹(子文件夹里的php文件也会被加密),加密后的压缩包需要先修复一下,步骤:打开压缩包 =》 工具 =》 修复压缩文件
二、效果展示
1.部分代码
代码如下(示例):
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['zipFile'], $_POST['encryptionKey'])) {
// 接收加密字符串
$encryptionKey = $_POST['encryptionKey'];
if (empty($encryptionKey)) {
$encryptionKey = "By 取码网 www.qumaw.com";
}
// 获取当前日期和时间
$date = date('Y-m-d');
$timestamp = date('YmdHis');
// 动态创建文件夹路径
$uploadDir = 'uploads/' . $date . '/';
$encryptedZipDir = 'encrypted/' . $date . '/';
// 检查并创建文件夹
if (!file_exists($uploadDir)) {
mkdir($uploadDir, 0777, true);
}
if (!file_exists($encryptedZipDir)) {
mkdir($encryptedZipDir, 0777, true);
}