diff options
Diffstat (limited to 'productdetails.php')
| -rw-r--r-- | productdetails.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/productdetails.php b/productdetails.php index 63ba451..44f3e04 100644 --- a/productdetails.php +++ b/productdetails.php @@ -1,4 +1,5 @@ <?php +session_start(); if(isset($_GET['id'])) { $id = $_GET['id']; @@ -31,11 +32,20 @@ if ( !is_object($product) ) <header><h1><?php echo $product->getName(); ?></h1></header> <nav> <dl> - <dt><a href="contact.html">Contact us</a></dt> + <dt><a href="contact.php">Contact us</a></dt> <dt><a href=".">Home</a></dt> <dt><a href="categories.php">Categories</a></dt> <dt><a href="products.php?id=<?php echo $catid; ?>">Back to Category</a></dt> - <dt><a href="login.html">Login</a></dt> + <?php + if(isset($_SESSION['username'])) + { + echo "<dt><a href=\"login.php?logout\">Logout</a></dt>"; + } + else + { + echo "<dt><a href=\"login.php\">Login</a></dt>"; + } + ?> </dl> </nav> <div id="content"> |
