Fixes errors and notices

main
Yasen Pramatarov 2024-10-31 11:35:41 +02:00
parent e084a04305
commit 1733e75dd1
2 changed files with 12 additions and 13 deletions

View File

@ -21,13 +21,6 @@ if (isset($_REQUEST['until_time'])) {
$until_time = htmlspecialchars($_REQUEST['until_time']);
}
if (isset($_SESSION['notice'])) {
$notice = htmlspecialchars($_SESSION['notice']); // 'notice' for all non-critical messages
}
if (isset($_SESSION['error'])) {
$error = htmlspecialchars($_SESSION['error']); // 'error' for errors
}
// hosts
if (isset($_POST['address'])) {
$address = htmlspecialchars($_POST['address']);

View File

@ -1,7 +1,13 @@
<?php if (isset($error)) { ?>
<div class="error"><?= $error ?></div>
<?php } ?>
<?php
<?php if (isset($notice)) { ?>
<div class="notice"><?= $notice ?></div>
<?php } ?>
// 'notice' for all non-critical messages
if (isset($_SESSION['error'])) {
echo "\t\t" . '<div class="error">' . $_SESSION['error'] . '</div>';
}
// 'error' for errors
if (isset($_SESSION['notice'])) {
echo "\t\t" . '<div class="notice">' . $_SESSION['notice'] . '</div>';
}
?>