/
profile.php
85 lines (77 loc) · 3.58 KB
/
profile.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
76
77
78
79
80
81
82
83
84
85
<?php
require('./connection.php');
require('./functions.php');
session_start();
if (isset($_SESSION['email'])) {
$email = $_SESSION['email'];
$select = "select name, email, DOB, phone, city from registration r, users u where r.id = u.id and r.email = '" . $email . "'";
$res = mysqli_query($con, $select);
if (mysqli_error($con)) {
echo "<scrpit>alert('Something went wrong');</script>";
unset($_SESSION);
header('location:login.php');
} else {
$row = mysqli_fetch_assoc($res);
$name = $row['name'];
$email = $row['email'];
$dob = $row['DOB'];
$pn = $row['phone'];
$city = $row['city'];
}
} else {
header('location:index.php');
}
?>
<!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">
<title>Profile</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body style="background: url('backg2.jpg'); background-size:cover">
<nav class="navbar navbar-light bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="profile.jpg" alt="" width="70" height="75" class="d-inline-block align-text-center">
<button type="button" class="btn btn-dark">Hello.! <?php echo $name?></button>
</a>
<a class='btn btn-danger' href="./logout.php">Logout</a>
</div>
</nav>
<div class='container'>
<div class="container" style="display: flex;
flex-direction: column;
align-items: center;
margin-top: 60px;
border-radius: 7px;
color: white;
background: #00000070;">
<h1>Profile Details</h1>
<table class="table text-white" >
<tbody>
<tr>
<td scope="row">Name</td>
<td>Email</td>
<td>DOB</td>
<td>Phone</td>
<td>City</td>
</tr>
<tr>
<td scope="row"><?php echo $name ?></td>
<td scope="row"><?php echo $email ?></td>
<td scope="row"><?php echo $dob ?></td>
<td scope="row"><?php echo $pn ?></td>
<td scope="row"><?php echo $city ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</body>
</html>