-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomepage.php
More file actions
executable file
·37 lines (31 loc) · 805 Bytes
/
homepage.php
File metadata and controls
executable file
·37 lines (31 loc) · 805 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
<?php
session_start();
if(!isset($_SESSION['email'])){
header("Location:login.php");
die("");
}
$email = $_SESSION['email'];
$conn = mysqli_connect("127.0.0.1","guest","password","phpsession") or die("Database Connection Error");
$query = "SELECT * from `user` where email = '".$email."'";
$result = mysqli_query($conn,$query);
$user = mysqli_fetch_assoc($result);
?>
<!DOCTYPE html>
<html>
<head>
<title>Homepage</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<h1>Welcome <?php echo $user['name']; ?></h1>
<img src="user.png">
<p>You are succesfully logged in</p>
<p>Email Id : <b><?php echo $user['email']; ?></b></p>
<br>
<p>
<a href="logout.php">Logout</a>
</p>
</div>
</body>
</html>