-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
60 lines (56 loc) · 1.68 KB
/
Copy pathheader.php
File metadata and controls
60 lines (56 loc) · 1.68 KB
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
50
51
52
53
54
55
56
57
58
59
60
<?php
//Decide if profile is active or needs registering
$header_status = 'My Profile';
$head_address = 'profile.php';
//Decide if profile is logged in or if it is due to be logged out
$log_status = 'Sign Out';
$log_address = 'logout.php';
// Initialize the session
//session_start();
// Check if the user is logged in, if not then redirect him to login page
$curr_name = '';
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
$header_status = 'Register';
$head_address = 'register.php';
$curr_name = "GUEST";
$log_status = 'Sign In';
$log_address = 'login.php';
}
else{
$curr_name = $_SESSION["username"];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="View/stylesheet.css">
<link rel="icon" href="./resources/favicon.ico">
</head>
<header>
<div class="clear"></div>
<div id="menu-bar-container">
<div id="menu-bar">
<h1 href="index.php">Camagru</h1>
<div id="menu-bar-top-right">
<a href="profile.php"><?php echo htmlspecialchars($curr_name); ?></a>
<a href="profile.php"><img src="./resources/grunt.png"></a>
</div>
</div>
<div class="clear"></div>
<div id="menu-bar-2-container">
<div id="menu-bar-2">
<a href="index.php">Home</a>
<a href="chat.php">Chat</a>
<a href="camera.php">Camera</a>
<!--a href="#">Welcome Page</a-->
<a href="upload.php">Upload</a>
<a href="gallery.php">Gallery</a>
<a href="contact.php">Contact Us</a>
<a href="<?php echo $head_address;?>"><?php echo $header_status; ?></a>
<a href="<?php echo $log_address;?>"><?php echo $log_status;?></a>
</div>
</div>
</div>
</header>
</html>