Please, I'm new to PHP and I'm building a subscription-based ecommerce site. I've been able to customize the pages such that they look different based on who's browsing what, but I'd like to take the Renew Account off the admin page since they don't have to subscribe.
I've been struggling all day. Please, could someone show me how it could be achieved? Below is the snippet:
<?php // Show the user info or the login form:
if (isset($_SESSION['user_id'])) {
// Show basic user options:
echo '<div class="title">
<h4>Manage Your Account</h4>
</div>
<ul>
<li><a href="renew.php" title="Renew Your Account">Renew Account</a></li>
<li><a href="change_password.php" title="Change Your Password">Change Password</a></li>
<li><a href="favorites.php" title="View Your Favorite Pages">Favorites</a></li>
<li><a href="history.php" title="View Your History">History</a></li>
<li><a href="recommendations.php" title="View Your Recommendations">Recommendations</a></li>
<li><a href="logout.php" title="Logout">Logout</a></li>
</ul>
';
// Show admin options, if appropriate:
if (isset($_SESSION['user_admin'])) {
echo '<div class="title">
<h4>Administration</h4>
</div>
<ul>
<li><a href="add_page.php" title="Add a Page">Add Page</a></li>
<li><a href="add_pdf.php" title="Add a PDF">Add PDF</a></li>
<li><a href="#" title="Blah">Blah</a></li>
</ul>
';
}
} else { // Show the login form:
require ('login_form.inc.php');
}
?>