-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
37 lines (20 loc) · 685 Bytes
/
Copy pathheader.php
File metadata and controls
37 lines (20 loc) · 685 Bytes
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
<?php
if (@$_SESSION['username']) {
?>
<center><a href="index.php">Home</a> | <a href="account.php"> My account</a> | <a href="members.php">Members </a> |
<?php
$query = "SELECT * FROM users WHERE username = '".$_SESSION['username']."'"; // we are trying to create profile here
$check = mysqli_query($db, $query);
$rows = mysqli_num_rows($check);
while($row = mysqli_fetch_assoc($check)){
$id = $row['id'];
}
echo "Logged in as <a href='profile.php?id=$id'>";
echo @$_SESSION['username']."</a> | ";
?>
<a href="index.php?action=logout"> logout</a> </center>
<?php
}else{
header("Location: login.php");
}
?>