summaryrefslogtreecommitdiffstats
path: root/products.php
diff options
context:
space:
mode:
Diffstat (limited to 'products.php')
-rw-r--r--products.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/products.php b/products.php
index 1591799..5827254 100644
--- a/products.php
+++ b/products.php
@@ -1,4 +1,5 @@
<?php
+session_start();
if(isset($_GET['id']))
{
$id = $_GET['id'];
@@ -27,10 +28,20 @@ $products = $category->getProducts();
<header><h1><?php echo $category->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="login.html">Login</a></dt>
+<?php
+if(isset($_SESSION['username']))
+{
+ echo "<dt><a href=\"login.php?logout\">Logout</a></dt>";
+ $username = $_SESSION['username'];
+}
+else
+{
+ echo "<dt><a href=\"login.php\">Login</a></dt>";
+}
+?>
</dl>
</nav>
<div id="content">