PDA

View Full Version : My Account


theowls
05-02-2015, 05:18 AM
On my menu I have "My Account", now I would like this to be invisible until the user has logged on. This my code for the menu:-
<div class="menubar">
<ul id="menu">
<li><a href="index.php">Home</a></li>
<li><a href="all_products.php">All Products</a></li>
<li><a href="customer/my_account.php">My Account</a></li>
<li><a href="customer_register.php">Sign Up</a></li>
<li><a href="cart.php">Shopping Cart</a></li>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php' style='color:orange;'>Login</a>";
}
else {
echo "<a href='logout.php' style='color:orange;'>Logout</a>";
}
?>
<li><a href="checkout.php">Checkout</a></li>
<li><a href="contact_us.php">Contact Us</a></li>
<li><a href="admin_area/index.php">Admin</a></li>
</ul>
</div>
Could someone help me achieve this please?
Thanks in advance

edbr
05-02-2015, 08:55 AM
if(isset($_SESSION['customer_email'])){
echo "......the <li>. With my account";
}
Sorry I'm using a headphone so not easy to write full code

theowls
05-02-2015, 11:37 PM
Thanks edbr for your reply, but i really don't understand it, plus your headphone quote has thrown me..sorry

edbr
05-04-2015, 02:08 AM
haha no problem i meant handphone but predictive text :)

if(isset($_SESSION['customer_email'])){
echo "<li><a href="customer/my_account.php">My Account</a></li>";
}