-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprofile.php
84 lines (65 loc) · 2.33 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
<?php
/* Displays user information and some useful messages */
session_start();
// Check if user is logged in using the session variable
if ( $_SESSION['logged_in'] != 1 ) {
$_SESSION['message'] = 'You must log in before viewing your profile page!';
header('location: error.php');
}
else {
// Makes it easier to read
$first_name = $_SESSION['first_name'];
$last_name = $_SESSION['last_name'];
$email = $_SESSION['email'];
$active = $_SESSION['active'];
}
header('location: DashBoard.php');
?>
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Welcome <?= $first_name.' '.$last_name ?></title>
<?php include 'css/css.html'; ?>
</head>
<body>
<div class="form">
<h1>Welcome</h1>
<p>
<?php
// Display message about account verification link only once
if ( isset($_SESSION['message']) )
{
echo htmlspecialchars($_SESSION['message']);
// Don't annoy the user with more messages upon page refresh
unset( $_SESSION['message'] );
}
?>
</p>
<?php
// Keep reminding the user this account is not active, until they activate
if(isset($active)){
if ( !$active ){
// echo and echo in tag html for this message
$str= '<div class="info">
Account is unverified, please confirm your email by clicking
on the email link!
</div>';
//echo '<div class="info">
// Account is unverified, please confirm your email by clicking
// on the email link!
// </div>';
echo $str;
}
}
?>
<h2><?php /*echo $first_name,' ,',$last_name;*/
echo htmlspecialchars($first_name), htmlspecialchars(' ,'), htmlspecialchars($last_name);
?></h2>
<p><?= $email ?></p>
<a href="logout.php"><button class="button button-block" name="logout"/>Log Out</button></a>
</div>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="js/index.js"></script>
</body>
</html>