-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbackup.php
47 lines (46 loc) · 1.66 KB
/
backup.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
<?php
session_start();
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){ // Check if user is logged in
header("location: index.html");
exit;
}
include 'database.php';
$email = $_SESSION["email"]; // Retrieve user profile information
$sql = "SELECT * FROM credentials WHERE email = '$email'";
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) { // Output data of each row
?>
<!DOCTYPE html>
<html>
<head>
<title>User Profile</title>
</head>
<body>
<h1>Welcome <?php echo $row["name"]; ?>!</h1>
<p>Here's your profile information:</p>
<ul>
<li>Name: <?php echo $row["name"]; ?></li>
<li>Email: <?php echo $row["email"]; ?></li>
<li>Phone: <?php echo $row["phone"]; ?></li>
<li>Blood Group: <?php echo $row["bloodgrp"]; ?></li>
<li>Gender: <?php echo $row["gender"]; ?></li>
<li>Date of Birth: <?php echo $row["birthdate"]; ?></li>
<li>Weight: <?php echo $row["weight"]; ?></li>
<li>Show Mobile: <?php echo $row["showmobile"]; ?></li>
<li>State: <?php echo $row["state"]; ?></li>
<li>SMS Alert: <?php echo $row["smsalert"]; ?></li>
<li>Zipcode: <?php echo $row["zipcode"]; ?></li>
<li>District: <?php echo $row["district"]; ?></li>
<li>Area: <?php echo $row["area"]; ?></li>
<li>Landmark: <?php echo $row["landmark"]; ?></li>
</ul>
</body>
</html>
<?php
}
} else {
echo "0 results";
}
mysqli_close($con);
?>