-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.php
49 lines (43 loc) · 1022 Bytes
/
menu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<h3>Menu</h3>
<?php require_once("functions.php");?>
<ul>
<?php if($file_name == "home.php"){
echo "<li>Home Page</li>";
}else{
echo '<li><a href="home.php">Home Page</a></li>';}
?>
<?php if($file_name == "login.php"){
echo "<li>Login</li>";
}else{
echo '<li><a href="login.php">Login</a></li>';}
?>
<?php if($file_name == "data.php"){
echo "<li>New Post</li>";
}else{
echo '<li><a href="data.php">New Post</a></li>';}
?>
<?php if($file_name == "table.php"){
echo "<li>Your Posts</li>";
}else{
echo '<li><a href="table.php">Your Posts</a></li>';}
?>
<?php if($file_name == "table2.php"){
echo "<li>Posts</li>";
}else{
echo '<li><a href="table2.php">Posts</a></li>';}
?>
</ul>
<?php
//logni välja
if(isset($_GET["logout"])){
//kustutab kõik session muutujad
session_destroy();
header("Location: login.php");
}
?>
<p>
<?php if(!isset($_SESSION["id_from_db"])){
}else{
echo '<a href="?logout=1"> Logout</a>';}
?>
</p>