-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
45 lines (44 loc) · 992 Bytes
/
profile.php
File metadata and controls
45 lines (44 loc) · 992 Bytes
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
<?php
session_start();
if (!isset($_SESSION['loggedin']))
{
header('Location: index.html');
exit();
}
$servername="localhost";
$username="root";
$password="root";
$dbname="phplogin";
$con= mysqli_connect($servername,$username,$password,$dbname);
if(mysqli_connect_error())
{
die('Failed to connect'.mysqli_connect_error());
}
$stmt = $con->prepare('SELECT password, email FROM history WHERE id = ?');
$stmt->bind_param('i', $_SESSION['id']);
$stmt->execute();
$stmt->bind_result($password, $email);
$stmt->fetch();
$stmt->close();
?>
<!DOCTYPE html>
<html>
<head>
<title>Profile</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="style.css">
</head>
<h2><u>Profile </u></h2>
<p><b>Your email address is:</b></p>
<table>
<tr>
<td><u>Email </u>:</td>
<td><?=$email?></td>
</tr>
</table>
<body>
<p>
<a href="logout.php"><h3>Logout<h3></a>
</p>
</body>
</html>