-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
48 lines (47 loc) · 1.16 KB
/
profile.php
File metadata and controls
48 lines (47 loc) · 1.16 KB
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
<html>
<head>
<link rel="stylesheet" href="profile.css">
</head>
<body>
<?php
session_start();
?>
<form method="post" class="form">
<div class="image">
<img src="images/profile.png" alt="">
</div>
<!-- <div class="sub-container">
<p>Name : <? $_SESSION["name"] ?></p>
</div> -->
<div class="content">
<?php
echo "<p>Name : ".$_SESSION["name"]."</p>";
echo "<p>Email : ".$_SESSION["mail"]."</p>";
?>
</div>
<div class="sub">
<input type="submit" name="logout" value="Logout">
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["logout"]))
{
if(!isset($_SESSION["name"]))
{
echo "<script> alert('You are not Logged in...')</script>";
header("location: login.php");
}
else
{
echo "<script> alert('Logged out Successfully...')</script>";
session_destroy();
header('Location: index.php');
}
}
if(isset($_POST["no"]))
{
header('Location: index.php');
}
?>