Update manage_albums.php
Browse files- manage_albums.php +7 -1
manage_albums.php
CHANGED
@@ -91,7 +91,7 @@ if (isset($_SESSION['password']) && $_SESSION['password'] === $correctPassword)
|
|
91 |
foreach ($images as $imageUrl) {
|
92 |
echo "<div style='text-align: center;'>";
|
93 |
echo "<a href='$imageUrl'><img src='$imageUrl' alt='Thumbnail' width='100' height='100'></a>";
|
94 |
-
echo "<form method='post' style='display: inline;'>";
|
95 |
echo "<input type='hidden' name='imageUrl' value='$imageUrl'>";
|
96 |
echo "<input type='submit' name='delete' value='删除'>";
|
97 |
echo "</form>";
|
@@ -136,6 +136,12 @@ if (isset($_SESSION['password']) && $_SESSION['password'] === $correctPassword)
|
|
136 |
echo "</form>";
|
137 |
}
|
138 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
<!-- HTML 内容 -->
|
140 |
</body>
|
141 |
</html>
|
|
|
91 |
foreach ($images as $imageUrl) {
|
92 |
echo "<div style='text-align: center;'>";
|
93 |
echo "<a href='$imageUrl'><img src='$imageUrl' alt='Thumbnail' width='100' height='100'></a>";
|
94 |
+
echo "<form method='post' style='display: inline;' onsubmit='return confirmDelete();'>";
|
95 |
echo "<input type='hidden' name='imageUrl' value='$imageUrl'>";
|
96 |
echo "<input type='submit' name='delete' value='删除'>";
|
97 |
echo "</form>";
|
|
|
136 |
echo "</form>";
|
137 |
}
|
138 |
?>
|
139 |
+
<script>
|
140 |
+
// JavaScript函数用于在删除操作前确认
|
141 |
+
function confirmDelete() {
|
142 |
+
return confirm('确定要删除这张图片吗?');
|
143 |
+
}
|
144 |
+
</script>
|
145 |
<!-- HTML 内容 -->
|
146 |
</body>
|
147 |
</html>
|