当前位置: 首页 > wzjs >正文

网站开发工作室营业执照怎么在服务器上装WordPress

网站开发工作室营业执照,怎么在服务器上装WordPress,小程序赚钱吗,大学科技园网站建设内部环境的服务资源下载页面有访问需求&#xff0c;给开发和产品人员编写一个简洁的下载页面提供资源下载。直接用nginxphp的形式去编写了&#xff0c;这里提供展示index.php文件代码如下&#xff1a; <?php // 配置常量 define(BASE_DIR, __DIR__); // 当前脚本所在目录作…

内部环境的服务资源下载页面有访问需求,给开发和产品人员编写一个简洁的下载页面提供资源下载。直接用nginx+php的形式去编写了,这里提供展示index.php文件代码如下:

<?php
// 配置常量
define('BASE_DIR', __DIR__); // 当前脚本所在目录作为根目录
define('ALLOWED_DIR', realpath(BASE_DIR)); // 安全校验路径// 处理文件下载
if (isset($_GET['download'])) {$filePath = realpath($_GET['download']);if ($filePath && strpos($filePath, ALLOWED_DIR) === 0 && is_file($filePath)) {header('Content-Type: application/octet-stream');header('Content-Disposition: attachment; filename="' . basename($filePath) . '"');header('Content-Length: ' . filesize($filePath));readfile($filePath);exit;} else {die('<div class="p-4 text-red-500">文件不存在或禁止访问</div>');}
}// 获取当前安全目录路径
$currentDir = isset($_GET['dir']) ? realpath($_GET['dir']) : ALLOWED_DIR;
if (!$currentDir || strpos($currentDir, ALLOWED_DIR) !== 0) {$currentDir = ALLOWED_DIR; // 非法路径重置为根目录
}// 获取文件列表
$files = scandir($currentDir);
$fileList = [];
foreach ($files as $file) {if ($file == '.' || $file == '..') continue;$fullPath = $currentDir . DIRECTORY_SEPARATOR . $file;$fileList[] = ['name' => $file,'type' => is_dir($fullPath) ? 'directory' : 'file','size' => is_file($fullPath) ? formatSize(filesize($fullPath)) : '-','mtime' => date('Y-m-d H:i:s', filemtime($fullPath)),'path' => $fullPath];
}// 辅助函数:格式化文件大小
function formatSize($bytes) {$units = ['B', 'KB', 'MB', 'GB'];$index = 0;while ($bytes >= 1024 && $index < 3) {$bytes /= 1024;$index++;}return round($bytes, 2) . ' ' . $units[$index];
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>文件管理系统</title><script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="p-8 bg-gray-50"><div class="max-w-4xl mx-auto bg-white rounded-lg shadow-md p-6"><h1 class="text-2xl font-bold text-gray-800 mb-6">文件列表: <?= htmlspecialchars(str_replace(ALLOWED_DIR, '/', $currentDir)) ?></h1><!-- 面包屑导航(仅在非根目录显示) --><nav class="mb-4 text-sm text-gray-600"><?php$parentDir = dirname($currentDir);if ($currentDir !== ALLOWED_DIR && $parentDir != $currentDir && strpos(realpath($parentDir), ALLOWED_DIR) === 0):?><a href="?dir=<?= urlencode($parentDir) ?>" class="text-blue-500 hover:text-blue-700">⬆ 上一级</a><?php endif; ?></nav><!-- 文件表格 --><table class="w-full border-collapse"><thead class="bg-gray-50"><tr><th class="p-3 text-left text-gray-500">名称</th><th class="p-3 text-left text-gray-500">类型</th><th class="p-3 text-left text-gray-500">大小</th><th class="p-3 text-left text-gray-500">修改时间</th><th class="p-3 text-left text-gray-500">操作</th></tr></thead><tbody><?php foreach ($fileList as $item): ?><tr class="hover:bg-gray-50 border-t"><td class="p-3"><?php if ($item['type'] == 'directory'): ?><a href="?dir=<?= urlencode($item['path']) ?>" class="text-blue-500 hover:text-blue-700 flex items-center">📁 <?= htmlspecialchars($item['name']) ?></a><?php else: ?><span class="flex items-center">📄 <?= htmlspecialchars($item['name']) ?></span><?php endif; ?></td><td class="p-3 text-gray-600"><?= $item['type'] == 'directory' ? '文件夹' : '文件' ?></td><td class="p-3 text-gray-600"><?= $item['size'] ?></td><td class="p-3 text-gray-600"><?= $item['mtime'] ?></td><td class="p-3"><?php if ($item['type'] == 'file'): ?><a href="?download=<?= urlencode($item['path']) ?>" class="px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors">下载</a><?php else: ?><span class="text-gray-400">-</span><?php endif; ?></td></tr><?php endforeach; ?></tbody></table></div>
</body>
</html>

最终的页面展示:


文章转载自:

http://Ab4RK6DY.jkzjs.cn
http://A6tQQitU.jkzjs.cn
http://kgMtWKQU.jkzjs.cn
http://ytYnZwKc.jkzjs.cn
http://QWF6AWlz.jkzjs.cn
http://bZaGBJ5x.jkzjs.cn
http://btpEofTb.jkzjs.cn
http://qA0yYbyH.jkzjs.cn
http://UwyQGzH5.jkzjs.cn
http://QGFYHQbA.jkzjs.cn
http://HRpYGNy1.jkzjs.cn
http://pK9OtCjD.jkzjs.cn
http://1qV4QNTD.jkzjs.cn
http://mIptC2iE.jkzjs.cn
http://3oiv9ANc.jkzjs.cn
http://Pv5CGSB9.jkzjs.cn
http://hYT3dwkm.jkzjs.cn
http://GvDGUnAl.jkzjs.cn
http://v68IDlzd.jkzjs.cn
http://s1iX6Fq3.jkzjs.cn
http://4AU8EaRf.jkzjs.cn
http://ei96A44p.jkzjs.cn
http://fu7akFAS.jkzjs.cn
http://hhaj21W9.jkzjs.cn
http://PmfvKuIY.jkzjs.cn
http://qeyyduZn.jkzjs.cn
http://2ZHhKlEx.jkzjs.cn
http://JKTLHVje.jkzjs.cn
http://DsEEa8YF.jkzjs.cn
http://bvvLqbgg.jkzjs.cn
http://www.dtcms.com/wzjs/708233.html

相关文章:

  • 网站开发技术职责企业建设项目哪个网站可以查
  • 湖南智能网站建设公司怎么查设计的logo侵不侵权
  • 做英文网站有哪些wordpress 快递插件
  • 网站建设网站建设教程视觉设计公司名字
  • 网站建设什么价格百度网站链接提交
  • 唯品会网站建设数据安全分析微信营销策划方案范文
  • 做网站用什么字体比较好开发公司工程部岗位职责
  • 谷歌网站排名江苏省城乡建设部网站首页
  • 天成信息网站建设自助建站平台wordpress占用多少内存
  • 网站运营做内容网站建设的公司联系方式
  • 新乡公司做网站找哪家公司好建设人行官方网站下载
  • 做视频网站 视频放在哪做猎头需要用到的网站
  • 企业网站的基本要素广州网站设计皆赞乐云践新
  • 重庆门户网站华龙网咨询公司网站模板
  • 品牌网是什么网站创意二维码制作网站
  • 帝国cms 网站描述的全局变量建个网站多少钱app
  • 网站开发怎么自学怎么做网站代销
  • 门户网站建设维护怎么看网站有没有做301
  • 南京网站建设公司 雷仁网络网络营销是指什么
  • 建设银行信用卡申请官方网站商务网站建设的流程图
  • 网站设计稿chown wordpress
  • 西安制作网站公司简介网站备案照片 多少钱
  • 本地网站建设官网wordpress询价管理
  • 镇江网站制作优化深圳建设工程交易服务网官网龙岗
  • 众筹网站开发周期推广赚钱
  • 正规货源网站大全怎样推广一个产品
  • 58做网站网络推广的工作好做吗
  • 企业应如何进行网站建设网站开发英文论文资料
  • 怎么把网站加入黑名单瀑布流网站模板
  • 网站开发需要什么开发工具上海有什么公司名称