-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathprofile.php
More file actions
75 lines (59 loc) · 2.05 KB
/
profile.php
File metadata and controls
75 lines (59 loc) · 2.05 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
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
<?php
/*Yeah! Displays user information and some useful messages */
session_start();
//Yeah! 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 {
//Yeah! Makes it easier to read
$first_name = $_SESSION['first_name'];
$last_name = $_SESSION['last_name'];
$email = $_SESSION['email'];
$active = $_SESSION['active'];
}
?>
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Welcome <?= $first_name.' '.$last_name ?></title>
<?php include 'css/css.html'; ?>
</head>
<body>
<!--Yeah! Display Site Logo at The Top-->
<a href="http://www.tonycletus.com"><img src="img/logo.png"></a>
<div class="form">
<h1>Welcome</h1>
<p>
<?php
//Yeah! Display message about account verification link only once
if ( isset($_SESSION['message']) )
{
echo $_SESSION['message'];
//Yeah! Don't annoy the user with more messages upon page refresh
unset( $_SESSION['message'] );
}
?>
</p>
<?php
//Yeah! Keep reminding the user this account is not active, until they activate
if ( !$active ){
echo
'<div class="info">
Account is unverified, please confirm your email by clicking
on the email link!
</div>';
}
?>
<h2><?php echo $first_name.' '.$last_name; ?></h2>
<p><?= $email ?></p>
<a href="logout.php"><button class="button button-block" name="logout"/>Log Out</button></a>
</div>
<!--Load Cloudflare jquery.min.js online-->
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<!--Load index.js from the resource folder-->
<script src="js/index.js"></script>
</body>
</html>