Update index.php

兼容多平台多级目录。
This commit is contained in:
sunson 2024-12-12 15:51:16 +08:00
parent fab7f581c1
commit c992c7c9c0

View File

@ -7,7 +7,7 @@ if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
$http = "https://";
}
$base_dir = $http . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']);
if(substr($base_dir,-1,1)=="/"){$base_dir=substr($base_dir,0,str_len($base_dir)-1);}
if(substr($base_dir,-1,1)=="/"){$base_dir=substr($base_dir,0,-1);}
$user = array("chate.store"); // 用户名,可多个
$pwd = array("123456"); // 密码,跟用户对应,请记得更换
if (isset($_GET['type'])) {
@ -114,7 +114,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) {
<meta name="description" content="SIW图床-基于PHP的图床服务">
<meta name="keywords" content="SIW图床,PHP图床,图床">
<link rel="stylesheet" href="http://cdn.atusu.cn/202410/bootstrap.min.css">
<script src="http://cdn.atusu.cn/202410/jquery.min.js"></script>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<title>SIW图床-基于PHP的图床服务</title>
<style>
html, body {