Update updateArticle.php

This commit is contained in:
2026-06-01 12:49:45 +02:00
parent a24914126f
commit 268fe6a6b9
+16 -9
View File
@@ -53,17 +53,21 @@ include_once 'php/controller/showArticle-controller.php';
?> ?>
<input type="text" id="title" name="title" <input type="text" id="title" name="title"
value="<?php value="<?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'])){
echo htmlspecialchars($_SESSION['old_title']);
unset($_SESSION['old_title']);
}
echo htmlspecialchars($_SESSION['old_title'] ?? '');
unset($_SESSION['old_title']);
?>" ?>"
placeholder="Titel hier eingeben" required> placeholder="Titel hier eingeben" required>
<textarea id="content" name="content" placeholder="Schreibe deinen Beitrag..."> <textarea id="content" name="content" placeholder="Schreibe deinen Beitrag...">
<?php <?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'])){
echo htmlspecialchars($_SESSION['old_content'] ?? ''); unset($_SESSION['old_content']); echo htmlspecialchars($_SESSION['old_content']);
unset($_SESSION['old_content']);
}
?> ?>
</textarea> </textarea>
</main> </main>
@@ -124,9 +128,12 @@ include_once 'php/controller/showArticle-controller.php';
<label for="tags">Schlagwörter</label> <label for="tags">Schlagwörter</label>
<input type="text" id="tags" name="tags" <input type="text" id="tags" name="tags"
value="<?php value="<?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'])){
echo htmlspecialchars($_SESSION['old_tags'] ?? ''); unset($_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)">
</div> </div>