denbooru-php/include/header.php

62 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2020-05-09 18:53:47 +00:00
<style>
body{
background-color: black;
}
*{
color: white;
font-family: monospace;
}
input{
background-color: black;
padding: 5px;
border: 1px solid white;
}
a:visited{
color: grey;
}
#header{
text-align: center;
}
2020-12-24 09:04:19 +00:00
.alert{
margin: 20px;
padding: 5px;
color: orange;
border: solid orange 1px;
margin: auto;
width: 60vw;
}
2020-05-09 18:53:47 +00:00
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div id="header">
<?php
//if($_SESSION["login"] === true) echo "You are logged in - <a href='/logout.php'>logout</a>";
print("<a href='" . $BASE_PATH . "/'>Home</a> ");
if($_SESSION["login"] === true){
echo "<a href='/logout.php'>logout</a>";
if($_SESSION["username"] == "admin"){
print(" <a href='" . $BASE_PATH . "/admin.php'>Admin</a>");
}
}
else{
echo "<a href='/login.php'>Login</a>";
}
2020-05-09 18:53:47 +00:00
?>
<h1>Dendy\'s Suckless Booru</h1>
2020-05-09 18:53:47 +00:00
<form method="GET" action="tag.php">
<input type="text" name="t" value="<?php if($_GET["t"]) echo $_GET["t"]; ?>">
<input type="submit">
</form>
2020-12-24 09:04:19 +00:00
<?php
if(isset($_SESSION["msg"]) and is_array($_SESSION["msg"])){
foreach($_SESSION["msg"] as $message){
echo("<div class='alert'>" . $message . "</div>");
$_SESSION["msg"] = array();
}
}
?>
2020-05-09 18:53:47 +00:00
</div>