Jump to content

Menu selection based on current pages


Lassie

Recommended Posts

I want to show a secondary menu based on a user logging in and the current page he is on.

I have a seession id to test fro and a check whether the current page is a page that should not display the secondary menu.

The problem is it doesnt work for mutiple pages and seems a long way of going about it. The pages that I dont want the secondary menu to show on are all in a seprerate directory ./reg/xxx.php  Is there a better way?



<?php
// Display links based upon the login status.
			// Show LOGIN links if this is the LOGOUT page.
				if (isset($_SESSION['user_id']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'register.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'index.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'forgot_password.php')AND(substr($_SERVER['PHP_SELF'], -10) != 'view_account2.php')) )
				{
					?>

Link to comment
https://forums.phpfreaks.com/topic/94715-menu-selection-based-on-current-pages/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.