fodo
03-06-2008, 05:47 PM
I need to display a secondary menu when a user is logged in but not show that menu on certain pages.The restricted pages are all in 1 folder ./reg/
I would like to include all the conditions in an if statement.
At present the test for the user session works but not the pages.
Can anyone help please.
<?php
// Display links based upon the login status.
// Show LOGIN links if this is the LOGOUT page.
$currentPage=basename($_SERVER['SCRIPT_NAME']);
if (isset($_SESSION['user_id']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php'||'login.php'||'view-account2.php'))
{
?>
//javascript goes here for menu
<php
}
?>
I would like to include all the conditions in an if statement.
At present the test for the user session works but not the pages.
Can anyone help please.
<?php
// Display links based upon the login status.
// Show LOGIN links if this is the LOGOUT page.
$currentPage=basename($_SERVER['SCRIPT_NAME']);
if (isset($_SESSION['user_id']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php'||'login.php'||'view-account2.php'))
{
?>
//javascript goes here for menu
<php
}
?>