here's my miniaccount.php..
Code: Select all
<?
//this php function checks the user if he/she is logged in
function checkUser()
{
// if the session id is not set, redirect to login page
if (!isset($_SESSION['thesis1_customer_id'])) {
header('Location: ' . WEB_ROOT . 'include/login.php');
exit;
}
// the user want to logout
if (isset($_GET['logout'])) {
doLogout();
}
}
?>
<br/>
<table cellpadding="0" cellspacing="10" border="0" bgcolor="#6CFF9D" width="170" style="font-family:sans-serif">
<tr>
<td align="center" style="font-size:14px;background-color:#461B7E;color:#ffffff">MY ACCOUNT MENU</td>
</tr>
<tr>
<!--if logged in, user can edit/view profile..else if the user is not logged redirect to login.php-->
<td class="accountmenu"><a href="" class="accmenu">View/Edit Profile</a></td>
</tr>
<tr>
<!--if logged in, user can edit/view cart..else if the user is not logged redirect to login.php-->
<td class="accountmenu"><a href="" class="accmenu">View Shopping Cart</a></td>
</tr>
<tr>
<!--if logged in, user can view orders..else if the user is not logged redirect to login.php-->
<td class="accountmenu"><a href="" class="accmenu">View Order History</a></td>
</tr>
<tr>
<!--if logged in, hide this menu..else if the user is not logged in show this login.php link-->
<td class="accountmenu" ><a href="" class="accmenu">Login</a></td>
</tr>
<tr>
<!--if logged in, hide this menu..else if the user is not logged in show this registration.php link-->
<td class="accountmenu"><a href="" class="accmenu">Register</a></td>
</tr>
<tr>
<!----hide this menu if not logged in..else if logged in show this menu--->
<td class="accountmenu"><a href="" class="accmenu">Logout</a></td>
</tr>
</table>