-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavigation.php
More file actions
43 lines (34 loc) · 1.27 KB
/
navigation.php
File metadata and controls
43 lines (34 loc) · 1.27 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
<?php
$conn = mysqli_connect("localhost","root","","project");
if (mysqli_connect_errno()) {
echo "Failed to connect to database.";
}
if(isset($_POST['Logout']))
{
session_destroy();
header("Location:loginpage.php");
}
$myemail = $_SESSION['email'];
$sql="SELECT * FROM accounts WHERE email='$myemail'";
$result=mysqli_query($conn,$sql);
$count = mysqli_num_rows($result);
$row=mysqli_fetch_array($result,MYSQLI_NUM);
$user = $row[1];
?>
<form method = "post" action = "">
<head>
<link rel="stylesheet" href="projectstyle.css">
<link href='https://fonts.googleapis.com/css?family=Maven Pro' rel='stylesheet'>
<nav class = "navigation">
<div class="navbar">
<a href="dashboard.php">Dashboard</a>
<a href="accounts.php">Accounts</a>
<a href="events.php">Events</a>
<a href="pages.php">Pages</a>
<a href="contacts.php">Contact Us</a>
<input type = "submit" class = "button" name = "Logout" value = "Logout" style="float: right; margin-top: 5px; padding: 10px; margin-bottom: 2px; width: 100px; margin-right: 30px;margin-top: 3px">
<a id = "session" style = " float:right; color:white; margin-right: 40px;"><?php echo "Welcome $user"; ?></a>
</div>
</nav>
</head>
</form>