-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnavbar.php
53 lines (48 loc) · 1.46 KB
/
navbar.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
50
51
52
53
<?php
if (isset($_SESSION['uid'])) {
include 'connect.php';
$sql = "SELECT * FROM user WHERE uid=" . $_SESSION["uid"] . ";";
$res = $db->query($sql);
if ($res == True) {
while ($obj = $res->fetch_object()) {
$user = $obj->firstName;
}
;
}
}
?>
<section class="navbar">
<div class="container">
<form method="post" action="userMain.php">
<div class="menu text-right">
<ul>
<li>
<a href="userMain.php">Home</a>
</li>
<?php if(isset($_SESSION['uid'])){?>
<li>
<a href="order_history.php">Past orders</a>
</li>
<?php } ?>
<?php if(isset($_SESSION['uid'])){?>
<li>
<input class="btn btn-primary" name="uidMN" type = "submit" value='Hello <?php echo $user; ?>' />
<input
type="hidden" name="uidM" value=<?php echo $_SESSION["uid"]?>>
</li>
<?php } ?>
</ul>
</div>
</form>
<div class="clearfix"></div>
</div>
</section>
<?php
if(isset($_POST["uidMN"]))
{
unset($_SESSION["uid"]);
session_destroy();
$flag=0;
header("Location: userMain.php");
}
?>