Add message notification thingie
This commit is contained in:
parent
e6c41fa25a
commit
88f618b007
|
@ -26,4 +26,8 @@ if(!isset($_SESSION["login"])){
|
|||
$_IS_LOGGED = $_SESSION["login"] === "true";
|
||||
$_IS_ADMIN = $_SESSION["username"] === "admin";
|
||||
|
||||
if(!is_array($_SESSION["msg"])){
|
||||
$_SESSION["msg"] = array();
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -17,6 +17,14 @@
|
|||
#header{
|
||||
text-align: center;
|
||||
}
|
||||
.alert{
|
||||
margin: 20px;
|
||||
padding: 5px;
|
||||
color: orange;
|
||||
border: solid orange 1px;
|
||||
margin: auto;
|
||||
width: 60vw;
|
||||
}
|
||||
</style>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<div id="header">
|
||||
|
@ -41,4 +49,13 @@
|
|||
<input type="text" name="t" value="<?php if($_GET["t"]) echo $_GET["t"]; ?>">
|
||||
<input type="submit">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
if(isset($_SESSION["msg"]) and is_array($_SESSION["msg"])){
|
||||
foreach($_SESSION["msg"] as $message){
|
||||
echo("<div class='alert'>" . $message . "</div>");
|
||||
$_SESSION["msg"] = array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue