Okay, I cant undestand how can I get the EMail from my DB.
I want to display a profile page, where users can change their info, so far I created this:
This is the entire profile.php
page. Is there a tutorial.
<div class="text-center">
<h1>Profile Page</h1>
<hr>
<br>
</div>
<div class="content">
<!-- notification message -->
<?php if (isset($_SESSION['success'])) : ?>
<div class="error success">
<h3>
<?php
echo $_SESSION['success'];
unset($_SESSION['success']);
?>
</h3>
</div>
<?php endif ?>
<!-- logged in user information -->
<?php if (isset($_SESSION['username'])) : ?>
<div class="container">
<div class="row text-center">
<div class="col">
<h4>Welcome back <strong><?php echo $_SESSION['username']; ?></strong>!</h4>
<hr>
<p><strong>Your account details</strong></p>
<p>Your name is <?php echo $_SESSION['username']; ?></p>
<p>Your name is <p>Mail: <?php echo $_SESSION['email'];?></p>
<p> <a href="logout.php" class="btn btn-danger">Logout</a> </p>
</div>
<div class="col text-center">
<h4>My Orders [Coming Soon]</h4>
</div>
</div>
</div>
<?php endif ?>
</div>
</body>
</html>
I tried adding <p>Your name is <p>Mail: <?php echo $_SESSION['email'];?></p>
but I still get the following error Undefined index: email
, I really want to learn and understand this problem. Thanks
Your name is
Mail:
` this is invalid HTML – Cornel Raiu Mar 25 '20 at 16:56