-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshare.php
74 lines (67 loc) · 2.19 KB
/
share.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
session_start();
include_once "php/config.php";
$btn="";
if(isset($_SESSION['unique_id'])){
$user_id = mysqli_real_escape_string($conn, $_GET['user_id']);
$btn = '<p><a href="chat.php?user_id='.$user_id.'" class="btn-share">Chat</a></p>';
}else{
$btn = '<p><a href="index.php" class="btn-share">Home</a></p>';
}
?>
<?php include_once "header.php"; ?>
<link rel="stylesheet" href="info.css">
<body>
<?php
$user_id = mysqli_real_escape_string($conn, $_GET['user_id']);
$sql = mysqli_query($conn, "SELECT * FROM users WHERE unique_id = {$user_id}");
if (isset($_SESSION['unique_id']) && $_SESSION['unique_id'] == $user_id) {
$btn = '<p><a href="index.php" class="btn-share">Home</a></p>';
}
if(mysqli_num_rows($sql) > 0){
$row = mysqli_fetch_assoc($sql);
?>
<div class="wrapper">
<section class="chat-area">
<header style="border-bottom: 1px solid #e6e6e6;">
<div class="content" style="margin-top: 15px;">
<span style="margin: 20px; font-size: 18px; font-weight: 500;">Share Profile</span>
</div>
</header>
<div class="users-list">
<div class="img-area">
<div class="inner-area">
<img src="php/images/<?php echo $row['img']; ?>" onerror="this.src='php/images/Default.png'" alt="">
</div>
</div>
<div class="details">
<span>Full Name</span>
<p><?php echo $row['fname']. " " . $row['lname'] ?></p>
<span>About</span>
<p><?php echo $row['about'] ?></p>
<span>Unique ID</span>
<p><?php echo $row['unique_id'] ?></p>
<?php echo $btn; ?>
<?php
}else{
?>
<div class="wrapper">
<section class="chat-area">
<header style="border-bottom: 1px solid #e6e6e6;">
<div class="content" style="margin-top: 15px;">
<span style="margin: 20px; font-size: 18px; font-weight: 500;">Share Profile</span>
</div>
</header>
<div class="users-list">
<div class="details">
<div class="text">Profile Doesn't Exist</div><br>
<p><a href="index.php" class="btn-share">Home</a></p>
<?php
}
?>
</div>
</div>
</section>
</div>
</body>
</html>