forked from Mahekb/GetSpon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogout.php
More file actions
81 lines (63 loc) · 2.33 KB
/
Copy pathLogout.php
File metadata and controls
81 lines (63 loc) · 2.33 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
session_start();
?>
<?php
$islogin = "hidden";
$islogout = "visible";
if (isset($_SESSION['username']) && isset($_SESSION['login'])) {
$islogin = $_SESSION['login'];
$islogout = "hidden";
}
?>
<?php
$conn = mysqli_connect("localhost", "root", "", "Getspon");
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$uname = $_SESSION['username'];
$stmt2 = $conn->prepare("SELECT Firstname,Lastname FROM user_details WHERE Username=?");
$stmt2->bind_param('s', $uname);
$stmt2->execute();
$result2 = $stmt2->get_result();
while ($row = $result2->fetch_assoc()) {
$fn = $row['Firstname'];
$ln = $row['Lastname'];
}
$stmt2->close();
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Logout</title>
<style>
.uppercase {
text-transform: uppercase;
}
</style>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<ul>
<li><a class="left"><img src="Images/Mainlogo.jpg" width="100"> </a></li>
<li><a class="left" href="Home_page.php">Home</a></li>
<li><a class="left" href="#About">About</a></li>
<li><a class="left" href="#Contact">Contact</a></li>
<li style="visibility:<?php echo "$islogin" ?>"><a class="right" href="profilepage.php">Profile</a></li>
<li style="visibility:<?php echo "$islogin" ?>"><a class="right" href="Logout.php">Log out</a></li>
<li style="visibility:<?php echo "$islogin" ?>"><a class="right" href="Chat.php">Chat</a></li>
<li style="visibility:<?php echo "$islogin" ?>"><a class="right" href="Startup.php">Add your Startup</a></li>
<li style="visibility:<?php echo "$islogin" ?>"><a class="right" href="Events.php">Add new Event</a></li>
<li style="visibility:<?php echo "$islogout" ?>"><a class="right" href="Signup.php">Sign up</a></li>
<li style="visibility:<?php echo "$islogout" ?>"><a class="right" href="Login.php">Log in</a></li>
</ul><br />
<div align="center" id="log">
<h1>Logout</h1>
<img src="Images/login.jpg" height="150" width="150"></br>
<h1 class="uppercase"><?php echo $fn . " " . $ln ?></h1></br></br>
<form method="post" action="clearsession.php">
<button class="button" type="submit" name="logout">Logout</button><br><br>
</form>
</div>
</body>
</html>