Update manage_albums.php
Browse files- manage_albums.php +12 -0
manage_albums.php
CHANGED
@@ -44,6 +44,18 @@ if (isset($_SESSION['password']) && $_SESSION['password'] === $correctPassword)
|
|
44 |
echo "</form>";
|
45 |
echo "</div>";
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
// 如果设置了album参数,显示相册内容管理界面
|
48 |
if (isset($_GET['album'])) {
|
49 |
$albumName = basename($_GET['album'], '.txt');
|
|
|
44 |
echo "</form>";
|
45 |
echo "</div>";
|
46 |
|
47 |
+
// 处理创建新相册的操作
|
48 |
+
if (isset($_POST['create']) && !empty($_POST['newAlbumName'])) {
|
49 |
+
$newAlbumName = trim($_POST['newAlbumName']);
|
50 |
+
$newAlbumFile = $albumDir . $newAlbumName . '.txt';
|
51 |
+
if (!file_exists($newAlbumFile)) {
|
52 |
+
file_put_contents($newAlbumFile, '');
|
53 |
+
echo "<p>新相册 '{$newAlbumName}' 创建成功。</p>";
|
54 |
+
} else {
|
55 |
+
echo "<p>相册 '{$newAlbumName}' 已存在。</p>";
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
// 如果设置了album参数,显示相册内容管理界面
|
60 |
if (isset($_GET['album'])) {
|
61 |
$albumName = basename($_GET['album'], '.txt');
|