unset der Eingaben verschoben

This commit is contained in:
NOrtmann1
2026-06-09 19:05:04 +02:00
parent f54cf58dc2
commit 8cbd442371
2 changed files with 4 additions and 3 deletions
-3
View File
@@ -71,7 +71,6 @@ include_once 'php/controller/showArticle-controller.php';
if (isset($title) && !empty($title)){echo htmlspecialchars($title); if (isset($title) && !empty($title)){echo htmlspecialchars($title);
}elseif (isset($_SESSION['old_title']) && !empty($_SESSION['old_title'])){ }elseif (isset($_SESSION['old_title']) && !empty($_SESSION['old_title'])){
echo htmlspecialchars($_SESSION['old_title']); echo htmlspecialchars($_SESSION['old_title']);
unset($_SESSION['old_title']);
} }
?>" ?>"
@@ -81,7 +80,6 @@ include_once 'php/controller/showArticle-controller.php';
if (isset($content) && !empty($content)){echo htmlspecialchars($content); if (isset($content) && !empty($content)){echo htmlspecialchars($content);
}elseif (isset($_SESSION['old_content']) && !empty($_SESSION['old_content'])){ }elseif (isset($_SESSION['old_content']) && !empty($_SESSION['old_content'])){
echo htmlspecialchars($_SESSION['old_content']); echo htmlspecialchars($_SESSION['old_content']);
unset($_SESSION['old_content']);
} }
?> ?>
</textarea> </textarea>
@@ -146,7 +144,6 @@ include_once 'php/controller/showArticle-controller.php';
if (isset($tags) && !empty($tags)){echo htmlspecialchars($tags); if (isset($tags) && !empty($tags)){echo htmlspecialchars($tags);
} elseif (isset($_SESSION['old_tags']) && !empty($_SESSION['old_tags'])){ } elseif (isset($_SESSION['old_tags']) && !empty($_SESSION['old_tags'])){
echo htmlspecialchars($_SESSION['old_tags']); echo htmlspecialchars($_SESSION['old_tags']);
unset($_SESSION['old_tags']);
} }
?>" ?>"
placeholder="z.B. Technik, IT (mit Komma trennen)"> placeholder="z.B. Technik, IT (mit Komma trennen)">
@@ -87,6 +87,10 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
exit(); exit();
} }
$_SESSION["message"] = "article_updated"; $_SESSION["message"] = "article_updated";
unset($_SESSION['old_title']);
unset($_SESSION['old_content']);
unset($_SESSION['old_category']);
unset($_SESSION['old_tags']);
// Weiterleitung zur Homepage // Weiterleitung zur Homepage
header("location: ../../index.php?pfad=showArticle&id=$id"); header("location: ../../index.php?pfad=showArticle&id=$id");
} }