-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.php
38 lines (30 loc) · 971 Bytes
/
header.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
<?php
require_once 'connection.php';
@$sql = "SELECT * FROM register WHERE client_id =".$_COOKIE['client_id'];
@$result = $conn->query($sql);
@$row = mysqli_fetch_assoc($result);
@$name = $row["firstname"];
@$lastname = $row["lastname"];
@$client_id = $row["client_id"]; // taken from cookies
@$client_username = $row["firstname"]." ".$row["lastname"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="header.css">
</head>
<body>
<header>
<a href="post.php"><h1>Logo</h1></a>
<a href="post.php" id="home">Home</a>
<div class="account_controls">
<a href="home.php">Login/register</a>
<a href="logout.php">Logout</a>
</div>
</header>
<b><?php echo @$name; ?></b>
</body>
</html>