-
Notifications
You must be signed in to change notification settings - Fork 0
/
u_details.php
75 lines (71 loc) · 2.44 KB
/
u_details.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
75
<?php
session_start();
include './include/db/auth.php';
include_once './include/php/header.php';
if (!isset($_SESSION['name'])) {
Header("Location: login.php");
}
// Check if user ID is provided in the URL
if (isset($_GET['id'])) {
$userId = $_GET['id'];
// Retrieve user details based on user ID
$sql = "SELECT * FROM users WHERE id = '$userId'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$name = $row['name'];
$email = $row['email'];
$contact = $row['contact'];
$dob = $row['dob'];
$gender = $row['gender'];
$religion = $row['religion'];
$address = $row['address'];
$profileImage = $row['image'];
} else {
$name = "N/A";
$email = "N/A";
$contact = "N/A";
$dob = "N/A";
$gender = "N/A";
$religion = "N/A";
$address = "N/A";
$profileImage = "default.jpg";
}
} else {
// Redirect to the search page if no user ID is provided
header("Location: search.php");
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>User Details</title>
<link rel="stylesheet" href="./assets/css/style.css">
</head>
<body>
<div class="user-details-section">
<img src="./assets/img/<?php echo $profileImage; ?>" alt="Profile Image">
<div class="inner-container">
<h1>User Details</h1>
<div class="fle">
<div class="details">
<p><strong>Name:</strong> <?php echo $name; ?></p>
<p><strong>Email:</strong> <?php echo $email; ?></p>
<p><strong>Contact:</strong> <?php echo $contact; ?></p>
<p><strong>Date of Birth:</strong> <?php echo $dob; ?></p>
<p><strong>Gender:</strong> <?php echo $gender; ?></p>
<p><strong>Address:</strong> <?php echo $address; ?></p>
<p><strong>Religion:</strong> <?php echo $religion; ?></p>
</div>
<div class="bio">
<h1>About User</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.
Illo dolor sequi culpa, quo nulla ad, dolores eligendi accusamus,
delectus earum maiores necessitatibus? Soluta animi sapiente ab, quod sit aut distinctio?</p>
</div>
</div>
</div>
</div>
</body>
</html>